CVE Professor
/
All CVEs
CVE-2026-52803

CVE-2026-52803 — Gogs (< 0.15.0) — CWE-384

HIGH CVSS 7.6 ⚡ EPSS 0.6% CVE.org

Gogs is an open source self-hosted Git service. Prior to 0.15.0, Gogs does not regenerate the session ID after successful authentication. An attacker who forces a victim to use a known session ID can hijack the session after the victim logs in and take over the account. This issue is fixed in version 0.15.0.

Gogs is an open source self-hosted Git service. Prior to 0.15.0, Gogs does not regenerate the session ID after successful authentication. An attacker who forces a victim to use a known session ID can hijack the session after the victim logs in and take over the account. This issue is fixed in version 0.15.0.

CVSS v4.0 Vector Metrics
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
Attack Vector Network AV:N
Attack Complexity Low AC:L
Attack Reqs. Present AT:P
Privileges Req. None PR:N
User Interaction Passive UI:P
Vuln. Conf. High VC:H
Vuln. Integrity High VI:H
Vuln. Avail. None VA:N
Subseq. Conf. None SC:N
Subseq. Integ. None SI:N
Subseq. Avail. None SA:N
EPSS — Exploit Prediction Scoring System
0.6%
30-day probability
In the 49. percentile of all CVEs — higher exploitation probability than most vulnerabilities.
AI Security Analysis & Remediation

🎯 What is this vulnerability?

This vulnerability is a classic Session Fixation flaw (CWE-384) in the Gogs web application. The core technical deficiency lies in the session management logic during the authentication handshake.

When a user successfully authenticates (logs in), the application fails to regenerate the session identifier (Session ID). In a secure implementation, upon successful credential verification, the server should:
1. Invalidate the pre-authentication session.
2. Generate a new, cryptographically random Session ID.
3. Associate the new Session ID with the authenticated user's state.

In Gogs < 0.15.0, the Session ID remains constant before and after login. This allows an attacker who has previously established a session (and thus knows the Session ID) to hijack that session once the victim logs in using the same browser context or forced session ID. The attacker does not need to know the victim's password; they only need to force the victim to use a session ID that the attacker already controls.

The CVSS vector CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N confirms:

  • AV:N: Exploitable over the network.

  • AC:L: Low complexity (no race conditions or specific timing required).

  • AT:P: Attack requires User Interaction (the victim must log in).

  • PR:N: No prior privileges required (unauthenticated attacker).

  • UI:P: User interaction is required (victim must click a link and log in).

  • VC:H / VI:H: High impact on Confidentiality and Integrity (full account takeover).
  • ⚡ Attack Chain

    1. Discovery & Reconnaissance

    The attacker identifies a Gogs instance running a version prior to 0.15.0. This can be done via:
  • Banner Grabbing: Checking the Server header or the footer of the login page, which often displays the Gogs version.
  • Fingerprinting: Using tools like whatweb or nmap with Gogs-specific scripts.
  • Manual Inspection: Visiting / or /login and checking for version strings in the HTML source or API responses (e.g., /api/v1/version).
  • 2. Exploitation

    The attacker performs the following steps to hijack a victim's session:

    Step 1: Generate a Known Session ID
    The attacker initiates a request to the Gogs login page or any public endpoint to establish a session. The server responds with a Set-Cookie header containing a session ID (e.g., gogs_session_id=abc123...). The attacker records this ID.

    # Attacker initiates a session and captures the session ID
    curl -c /tmp/attacker_cookies.txt -s http://target-gogs.example.com/login
    # Output: Set-Cookie: gogs_session_id=abc123def456...; Path=/; HttpOnly

    Step 2: Force the Victim to Use the Known Session ID
    The attacker crafts a malicious link that sets the victim's browser cookie to the known session ID. This is typically done via a URL that triggers a session initialization or by embedding a JavaScript snippet in a phishing page that sets the cookie.

    Illustrative Example (Phishing Link):
    The attacker sends a link to the victim:
    http://target-gogs.example.com/login?session_id=abc123def456...

    Note: The exact parameter name for session fixation may vary. In many web frameworks, simply visiting a page with a pre-set cookie is sufficient. The attacker ensures the victim's browser has the cookie gogs_session_id=abc123def456... before the victim logs in.

    Step 3: Victim Logs In
    The victim clicks the link, is redirected to the login page, and enters their valid credentials. The server validates the credentials but does not regenerate the session ID. The session abc123def456... is now associated with the victim's authenticated account.

    Step 4: Attacker Hijacks the Session
    The attacker uses the known session ID to make authenticated requests to the Gogs API or web interface.

    # Attacker uses the known session ID to access the victim's account
    curl -b "gogs_session_id=abc123def456..." -s http://target-gogs.example.com/api/v1/user
    # Response: JSON object containing the victim's user details, proving session hijack

    3. Post-Exploitation

    Once the session is hijacked, the attacker has full access to the victim's account. Depending on the victim's role (e.g., admin, developer), the attacker can:
  • Read Private Repositories: Access source code, secrets, and configuration files.
  • Modify Code: Push malicious commits, alter CI/CD pipelines, or inject backdoors.
  • Access API Tokens: If the victim has stored API tokens in their profile, the attacker can extract them.
  • Privilege Escalation: If the victim is an administrator, the attacker can create new admin accounts, modify system settings, or delete repositories.
  • 🌍 Real World Impact

  • Confidentiality (High): The attacker can read all data accessible to the victim, including private repositories, issues, and comments.
  • Integrity (High): The attacker can modify code, issues, and user settings. This can lead to supply chain attacks if the victim has push access to critical repositories.
  • Availability (None): The vulnerability does not directly cause denial of service, but an attacker could delete repositories or lock out the victim.
  • Practical Consequences:
  • - Source Code Theft: Intellectual property loss. - Malware Injection: Attacker can push malicious code to production repositories. - Account Takeover: The victim may not realize their account has been compromised until it's too late. - Lateral Movement: If the victim has access to other systems via Gogs (e.g., CI/CD integrations), the attacker can pivot to those systems.

    🛡️ Remediation & Mitigation

    1. Upgrade

  • Affected Versions: Gogs < 0.15.0
  • Fixed Version: Gogs 0.15.0
  • Action: Immediately upgrade to Gogs 0.15.0 or later.
  • 2. Workarounds (If Immediate Upgrade is Not Possible)

  • Force Session Regeneration via Middleware: If you have access to the Gogs source code or can deploy a reverse proxy, implement a middleware that forces session ID regeneration after login. This is complex and not recommended as a long-term solution.
  • Restrict Access: Limit access to the Gogs instance to trusted IP ranges using firewall rules.
  • Disable Public Access: If the Gogs instance is not intended for public access, restrict it to internal networks only.
  • 3. Detection

  • Web Server Logs: Look for multiple login attempts from the same IP address with the same session ID.
  • Session ID Reuse: Monitor for session IDs that are used by multiple IP addresses or user agents.
  • Unusual Activity: Alert on sudden changes in repository access patterns or API calls from an authenticated session.
  • Example Log Pattern (Apache/Nginx):

    192.168.1.100 - - [26/Nov/2026:10:00:00 +0000] "GET /login HTTP/1.1" 200 - "http://target-gogs.example.com/" "Mozilla/5.0"
    192.168.1.100 - - [26/Nov/2026:10:00:05 +0000] "POST /login HTTP/1.1" 302 - "http://target-gogs.example.com/login" "Mozilla/5.0"
    192.168.1.100 - - [26/Nov/2026:10:00:10 +0000] "GET /api/v1/user HTTP/1.1" 200 - "http://target-gogs.example.com/login" "Mozilla/5.0"
    # Note: The session ID in the cookie should change after POST /login. If it remains the same, it's a potential session fixation.

    ModSecurity Rule (Illustrative):

    SecRule REQUEST_COOKIES:gogs_session_id "@rx ^[a-f0-9]{32}$" \
        "id:100001,phase:2,log,auditLog,msg:'Potential Session Fixation: Session ID not regenerated after login',severity:2"

    Note: This rule is illustrative and requires correlation with login events to be effective.

    ⚠️ Urgency

  • CVSS Score: 7.6 (HIGH)
  • CISA KEV: No
  • Exploit Complexity: Low
  • Patching Priority: High
Although this vulnerability is not currently listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, it is a high-severity issue with low exploitation complexity. Attackers can easily exploit this vulnerability to hijack sessions and gain unauthorized access to sensitive data. Organizations should prioritize upgrading to Gogs 0.15.0 or later as soon as possible, especially if the Gogs instance is exposed to the internet or contains sensitive data.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="gogs gogs"
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-52803
Technical reference / advisory repository for CVE-2026-52803
CVSS Score
7.6 / 10 · CVSS HIGH
Weakness Types (CWE)
CWE-384
Affected Products (1)
gogs:gogs (< 0.15.0)
References & Advisories (2)
Related CVEs
9.3
CVE-2026-144337
osTicket before 1.17.9 and 1.18.0 before 1.18.5 contains an unauthenticated stored cross-site scripting vulner
9.2
CVE-2026-144579
curl_cffi 0.15.0 through 0.17.0 contains a server-side request forgery protection bypass in allow_redirects='s
9.2
CVE-2026-144598
Homebox 0.22.0-rc.2 through 0.27.1 contains an authentication bypass vulnerability in UserService.LoginOIDC th
9.2
CVE-2026-145153
LangChain4j before 1.5.4-beta11, 1.11.12-beta19, 1.19.4-beta29, and 1.23.0-beta33 contains an injection vulner
9.1
CVE-2026-144956
Hoverfly before 1.12.17 contains an improper certificate validation vulnerability in GetHttpClient in core/htt
8.8
CVE-2026-77417
Local CI is a ground-up rewrite of the GitHub Actions orchestration layer that runs entirely on a personal mac
8.8
CVE-2026-77418
Local CI is a ground-up rewrite of the GitHub Actions orchestration layer that runs entirely on a personal mac