CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-26196

CVE-2026-26196: Sensitive API Token Exposure via URL Query Parameters in Gogs

Amit Schendel
Amit Schendel
Senior Security Researcher

Mar 5, 2026·5 min read·21 visits

Executive Summary (TL;DR)

Gogs versions < 0.14.2 allow API authentication via URL query strings. This exposes secret tokens to server logs and intermediaries. The fix in 0.14.2 removes query parameter support, enforcing the use of the `Authorization` header. Users must upgrade and rotate all existing tokens.

Gogs, a self-hosted Git service, contained a vulnerability in its API authentication mechanism prior to version 0.14.2. The application permitted the transmission of sensitive authentication tokens via URL query parameters (`token` and `access_token`). This architectural flaw resulted in the potential leakage of credentials to server access logs, proxy logs, browser history, and HTTP Referer headers, exposing users to account takeover risks.

Vulnerability Overview

Gogs is a widely deployed, self-hosted Git service written in Go. In versions prior to 0.14.2, the application's API authentication logic failed to adhere to secure transport standards for sensitive credentials. Specifically, the API accepted authentication tokens passed directly in the URL query string using parameters named token or access_token.

This implementation violates standard security practices defined in CWE-598 (Information Exposure Through Query Strings in GET Request). While convenient for quick scripting, passing secrets in the URL places them in components of the HTTP request that are not intended to be confidential. Unlike the HTTP Body or Headers, the Request Line (URI) is routinely logged in cleartext by web servers, proxies, and security appliances.

The vulnerability is classified as a passive information leak. It does not allow an attacker to break into the system directly via a crafted packet, but rather ensures that valid credentials are persistently recorded in locations accessible to a wider audience than intended, such as system administrators, log analysis tools, or attackers with local file inclusion (LFI) capabilities.

Root Cause Analysis

The root cause of this vulnerability lies in the authenticatedUserID function within internal/context/auth.go. This function is responsible for determining the identity of the user making an API request. The logic explicitly checked the URL query string for authentication material before checking standard HTTP headers.

The vulnerable code prioritized ease of use over security. When an API request was received, the application checked c.Query("token"). If that was empty, it checked c.Query("access_token"). Only if both were missing did the application proceed to inspect the Authorization header. This precedence encouraged users and client libraries to use the insecure query string method.

Because the token retrieval occurred early in the request lifecycle, the full URL—including the sensitive token—would be processed by the Go net/http stack and any reverse proxies (like Nginx or Apache) sitting in front of the Gogs instance. Standard logging configurations for these servers default to the Combined Log Format, which includes the requested resource path and query string.

Code Analysis & Patch

The remediation for CVE-2026-26196 involved removing the logic that parsed tokens from the query string entirely. The patch enforces the use of the Authorization header, which is the standard mechanism for bearer token authentication and is rarely logged by default.

Below is the analysis of the changes in internal/context/auth.go from commit 295bfba72993c372e7b338438947d8e1a6bed8fd:

Vulnerable Implementation (Pre-0.14.2):

// internal/context/auth.go
 
func authenticatedUserID(store AuthStore, c *macaron.Context, sess session.Store) int64 {
    // ...
    if isAPIPath(c.Req.URL.Path) {
        // VULNERABILITY: Tokens extracted from URL query
        tokenSHA := c.Query("token")
        if len(tokenSHA) <= 0 {
            tokenSHA = c.Query("access_token")
        }
        if tokenSHA == "" {
            // Only checks header if query params are empty
            auHead := c.Req.Header.Get("Authorization")
            // ...
        }
    }
}

Patched Implementation (v0.14.2):

// internal/context/auth.go
 
func authenticatedUserID(store AuthStore, c *macaron.Context, sess session.Store) int64 {
    // ...
    if isAPIPath(c.Req.URL.Path) {
        var tokenSHA string
        // FIX: Query string checks removed entirely.
        // Authentication now strictly requires the Authorization header.
        auHead := c.Req.Header.Get("Authorization")
        if auHead != "" {
            auths := strings.Fields(auHead)
            if len(auths) == 2 && auths[0] == "token" {
                tokenSHA = auths[1]
            }
        }
        // ...
    }
}

By removing the calls to c.Query, the maintainers eliminated the attack surface. Any client attempting to use the old query parameter method will now receive a 401 Unauthorized response, forcing the adoption of the secure header method.

Attack Vectors & Impact

The exploitation of this vulnerability relies on an attacker gaining access to historical request data. Several vectors exist for this leakage:

  1. Server Logs: Access logs (e.g., /var/log/nginx/access.log) retain the full request URI. An attacker who gains read access to these logs—perhaps via a separate Directory Traversal vulnerability or misconfigured permissions—can harvest valid tokens.
  2. Proxy & SIEM Logs: In enterprise environments, traffic often passes through transparent proxies or is forwarded to SIEM solutions (Splunk, ELK). If these systems are not configured to redact sensitive query parameters, the tokens become indexed and searchable by security analysts or attackers who compromise the logging infrastructure.
  3. Referer Headers: If a user visits a URL like https://gogs.local/api/v1/repos?token=XYZ and the API response contains a link to an external site, clicking that link may send the full URL (containing the token) in the Referer header to the external server.

Impact Assessment: The compromise of a Gogs API token is equivalent to compromising the user's password for API operations. Depending on the scope of the token and the user's privileges, an attacker could:

  • Clone private repositories (Intellectual Property theft).
  • Push malicious code to repositories (Supply Chain Attack).
  • Modify issue trackers or wiki pages.
  • If the user is an administrator, the attacker could potentially gain full control over the Gogs instance.

Remediation & Mitigation

The primary remediation is to upgrade the Gogs instance to version 0.14.2 or later immediately. This version drops support for query-based authentication, neutralizing the vulnerability.

Critical Post-Upgrade Step: Token Rotation Upgrading the software stops future leaks, but it does not invalidate tokens that have already been logged. Security teams must assume that all tokens used prior to the upgrade are compromised. Users should be forced or instructed to revoke existing Personal Access Tokens and generate new ones.

Log Sanitization Administrators should scan existing web server and proxy logs for patterns matching token= or access_token=. These logs should be scrubbed or deleted to prevent historical data mining by attackers. Future logging configurations should be reviewed to ensure query strings are either excluded or sanitized of sensitive keys.

Official Patches

GogsGogs v0.14.2 Release Notes
GogsFix Commit on GitHub

Fix Analysis (1)

Technical Appendix

CVSS Score
6.9/ 10
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

Affected Systems

Gogs (Self-Hosted Git Service)

Affected Versions Detail

Product
Affected Versions
Fixed Version
Gogs
Gogs
< 0.14.20.14.2
AttributeDetail
CVE IDCVE-2026-26196
CVSS v4.06.9 (Medium)
CWE IDCWE-598
ImpactInformation Disclosure (Credential Leak)
Attack VectorNetwork (Passive)
Patch Commit295bfba7299

MITRE ATT&CK Mapping

T1552.003Unsecured Credentials: Bash History
Credential Access
T1040Network Sniffing
Credential Access
CWE-598
Information Exposure Through Query Strings in GET Request

Use of GET Request Method With Sensitive Query Strings

Known Exploits & Detection

GHSAGitHub Security Advisory Details

Vulnerability Timeline

Vulnerability Fixed in Main Branch
2026-02-13
Public Disclosure & CVE Published
2026-03-05
Version 0.14.2 Released
2026-03-05

References & Sources

  • [1]GHSA-x9p5-w45c-7ffc
  • [2]Pull Request #8177

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•7 minutes ago•CVE-2026-40181
6.6

CVE-2026-40181: Open Redirect Vulnerability in React Router

An open redirect vulnerability exists in the react-router library due to insufficient validation of double-slash prefix paths in the redirect programmatic navigation helper. Attackers can leverage this to bypass standard destination validation checks and redirect users to malicious domains. This occurs because browsers interpret double-slash URLs as protocol-relative targets rather than relative application paths.

Amit Schendel
Amit Schendel
0 views•7 min read
•38 minutes ago•CVE-2022-31114
5.1

CVE-2022-31114: Reflected Cross-Site Scripting in Laravel Backpack Error Views

CVE-2022-31114 is a Reflected Cross-Site Scripting (XSS) vulnerability affecting the popular administrative panel package 'backpack/crud'. The flaw is rooted in the unsafe, raw rendering of PHP exception messages within the default error templates. When an unescaped exception message reflects malicious user-provided input, arbitrary JavaScript can execute within an administrator's browser session.

Alon Barad
Alon Barad
3 views•6 min read
•about 3 hours ago•CVE-2024-52011
7.5

CVE-2024-52011: Remote Command Injection in ViteJS launch-editor

CVE-2024-52011 is a critical command injection vulnerability in the ViteJS launch-editor utility (versions prior to 2.9.0) affecting Windows environments. Unsanitized command-line arguments can lead to remote code execution on a developer workstation via cross-origin requests targeting the local development server.

Amit Schendel
Amit Schendel
3 views•7 min read
•about 8 hours ago•CVE-2025-10230
10.0

CVE-2025-10230: Samba Active Directory Domain Controller WINS Server Hook Command Injection

A critical OS command injection vulnerability exists in Samba's Windows Internet Name Service (WINS) server implementation when configured to run as an Active Directory Domain Controller (AD DC). Unsanitized NetBIOS name data extracted from WINS registration packets is directly concatenated into a shell command invocation and executed via Samba's wins hook parameter.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 10 hours ago•GHSA-XQ3M-2V4X-88GG
9.8

CVE-2026-41242: Remote Code Execution via Dynamic Code Generation in protobufjs

CVE-2026-41242 is a critical code injection vulnerability in protobufjs. The library compiles custom serialization functions at runtime using the `Function` constructor. Prior to versions 7.5.5 and 8.0.1, dynamic type names were not sanitized, allowing an attacker to inject arbitrary JavaScript via crafted schema definitions, leading to remote code execution.

Amit Schendel
Amit Schendel
6 views•7 min read
•about 12 hours ago•GHSA-63GR-G7JC-V8RG
9.8

GHSA-63GR-G7JC-V8RG: Missing Authentication in AgenticMail MCP HTTP Transport Layer

An architectural flaw in the optional Streamable HTTP transport mode of @agenticmail/mcp allows unauthenticated remote network clients to execute administrative API commands. The server, holding the AGENTICMAIL_MASTER_KEY, functions as a confused deputy, letting attackers run privileged functions like deleting agents and establishing mail relays.

Alon Barad
Alon Barad
3 views•8 min read