Skip to main content

Gogs CVE-2026-52802

| EUVDEUVD-2026-39068 MEDIUM
URL Redirection to Untrusted Site (Open Redirect) (CWE-601)
2026-06-23 https://github.com/gogs/gogs GHSA-xxhq-69mf-w8cr
5.4
CVSS 3.1 · Vendor: https://github.com/gogs/gogs
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft login URL with backslash bypass in redirect_to
  2. Delivery
    Deliver link to victim via phishing
  3. Exploit
    Victim authenticates on legitimate Gogs instance
  4. Execution
    Server-side IsSameSite() validation bypassed
  5. Persist
    Browser normalizes backslash to produce //attacker.com
  6. Impact
    Victim redirected to attacker-controlled site

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V3 - Web Frontend Security Redirect URL validation
MITRE ATT&CK

1 technique across 1 tactic: Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The attacker must deliver a crafted Gogs URL containing a redirect_to parameter with a backslash-based bypass path (e.g., /a/../\attacker.com) to a victim user who then clicks the link and completes authentication on the Gogs instance. The redirect_to parameter is accepted on the /user/login endpoint and all other post-action flows in default Gogs deployments running version 0.14.2 or earlier-no non-default configuration is required. Exploitation is constrained by the mandatory victim interaction: the redirect only fires after the victim actively authenticates (UI:R in CVSS), meaning the attacker cannot trigger external redirects for unauthenticated visitors. Additionally, the attacker has no visibility into whether the victim successfully logged in until the victim lands on the attacker-controlled destination.

Impact

The CVSS 3.1 vector AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N yields a score of 5.4, reflecting that exploitation requires victim interaction (the user must click a crafted URL and complete login) but imposes no complexity or privilege requirements on the attacker. No EPSS data was provided in the intelligence feed; exploitation probability cannot be quantified independently. The vulnerability is absent from CISA KEV, so confirmed in-the-wild exploitation is not established. Despite the moderate CVSS score, the risk is meaningfully elevated by: (1) a working public PoC with step-by-step screenshots published in the GHSA advisory, (2) the attack surface being the high-traffic login endpoint of a Git hosting service, and (3) the potential for OAuth/SSO token exfiltration in deployments using Gogs as an identity provider. AC:L confirms no race condition or non-default environment is needed. The C:L and I:L ratings reflect indirect impact-credential harvesting and token theft-rather than direct server compromise, which is consistent with the open-redirect class.

Exploit ScenarioDerived

An attacker distributes a phishing message containing a legitimate-looking Gogs login URL with redirect_to=/a/../\attacker.com appended as a query parameter. The victim clicks the link, is presented with their real Gogs login page, and upon successful authentication is silently redirected to the attacker-controlled domain where a credential-harvesting page or token-capture endpoint is hosted. A working proof-of-concept demonstrating this exact flow is publicly documented with screenshots in GHSA-xxhq-69mf-w8cr.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.6% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 23, 2026

Open redirect in Gogs versions up to and including 0.14.2 allows unauthenticated remote attackers to craft login URLs that redirect authenticated users to arbitrary external sites after successful login. The root cause is a two-character-only URL validation in the IsSameSite() function: the path /a/../\example.com passes server-side inspection but resolves to //example.com after browsers normalize backslashes to forward slashes. A publicly available proof-of-concept with screenshots exists; this vulnerability is not in CISA KEV and active exploitation has not been confirmed at time of analysis.

RemediationAI

Upgrade Gogs to version 0.14.3 or later, which resolves the issue via PR #8322 (commit c5da9631dc75f692f313373ae229c4d47ba6517f). The patched IsSameSite() normalizes all backslash variants and whitespace before validation. If an immediate upgrade is not possible, deploy a reverse proxy (e.g., nginx map or if directive) in front of Gogs that rejects or strips redirect_to parameter values containing \, %5C, %5c, or whitespace characters; note this approach may break legitimate deep-link redirects and requires ongoing maintenance as new bypass variants emerge. For organizations using Gogs in OAuth or SSO flows, this issue should be treated as higher priority due to the authorization code leakage risk. Full advisory and patch details: https://github.com/gogs/gogs/security/advisories/GHSA-xxhq-69mf-w8cr.

Affected VersionsENISA

gogs < 0.14.3

Affected Packages

go gogs.io/gogs fix: 0.14.3
euvd gogs fix: 0.14.3

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in go, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Gogs is a self-hosted Git service written in Go (package gogs.io/gogs). The vulnerability (CWE-601: URL Redirection to Untrusted Site) resides in IsSameSite() inside internal/urlx/urlx.go. The original function validated redirect destinations by inspecting only the first two characters-requiring a leading / and rejecting / or \ as the second character. This check fails to account for directory traversal sequences before a backslash: /a/../\example.com satisfies the two-character rule, but RFC-compliant browser normalization of \ to / produces the protocol-relative URL //example.com, which resolves to an external host. The fix in PR #8322 (commit c5da9631) normalizes backslashes, percent-encoded variants (%5C, %5c), and whitespace control characters (\t, \n, \r) before validation, then asserts the result starts with / and contains no //. All redirect_to query parameter consumers are affected, including the login endpoint and post-action flows.

Know when Open Redirect gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/gogs/gogs) PRIMARY 5.4 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
vuln.today AI 5.4 MEDIUM

Network-accessible login endpoint requires no attacker privileges; victim must actively click crafted link and authenticate; no availability impact and scope unchanged.

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
SUSE MEDIUM

Primary rating from Vendor (https://github.com/gogs/gogs).

CVSS VectorVendor: https://github.com/gogs/gogs

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

DescriptionCVE.org

Summary

An open redirect vulnerability exists in Gogs where attacker-controlled redirect_to parameters can bypass validation, allowing redirection to arbitrary external sites.

Details

All redirects in Gogs that are validated via the IsSameSite function are vulnerable:

go
func IsSameSite(url string) bool {
    return len(url) >= 2 && url[0] == '/' && url[1] != '/' && url[1] != '\\'
}

The function only inspects the first two characters of the URL string. This check fails to account for directory traversal sequences followed by backslashes. For example:

/a/../\example.com

The IsSameSite function checks the input supplied to the redirect_to query parameter value /a/../\example.com and considers it valid.

Because web browsers normalize backslashes \ to forward slashes /, the normalized URL becomes //example.com.

The normalized URL becomes:

//example.com

Resulting in a cross-origin redirect.

This affects all endpoints using the redirect_to query parameter, including login and other post-action flows.

PoC

  1. An attacker can provide a user with a link to login to Gogs with a redirect_to query parameter that redirects a user to a site the attacker wants them to visit:
http://192.168.236.132:3000/user/login?redirect_to=/a/../\example.com

<img width="1339" height="536" alt="image" src="https://github.com/user-attachments/assets/3c2a13b8-f0b7-42c2-a223-6f0ebf083589" />

<br> <br>

  1. After the user successfully logs in, they would be redirected to the site an attacker wants them to visit:

<img width="1066" height="463" alt="image" src="https://github.com/user-attachments/assets/1726a3d9-6705-43cc-bdd2-90aad105d021" />

<img width="1097" height="396" alt="image" src="https://github.com/user-attachments/assets/376052f5-0e00-4d14-a548-fa75a6269530" />

Impact

  • Phishing: Attackers can use trusted domain links to redirect victims to credential-harvesting pages
  • OAuth/SSO Token Theft: In authentication flows, authorization codes or tokens may leak via redirect
  • Referer Leakage: Sensitive URL parameters may be exposed to attacker domains via the Referer header
  • Cache Poisoning: In deployments with shared caches, malicious redirects may be cached and served to other users

Threat Intelligence Overview

EPSS Score
0.6%
Top 58% exploitable
Prevalence
Low
niche self-hosted Git platform, much smaller footprint than GitLab or Gitea
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.6%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

28
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +27
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

CVE-2017-1000117 HIGH POC
8.8 Oct 05

A malicious third-party can give a crafted "ssh://..." URL to an unsuspecting victim, and an attempt to visit the URL ca

CVE-2024-52875 HIGH POC
8.8 Jan 31

GFI Kerio Control versions 9.2.5 through 9.4.5 contain an HTTP response splitting vulnerability in the dest parameter of

CVE-2016-5385 HIGH POC
8.1 Jul 19

PHP through 7.0.8 does not attempt to address RFC 3875 section 4.1.18 namespace conflicts and therefore does not protect

CVE-2013-2248 MEDIUM POC
5.8 Jul 20

Multiple open redirect vulnerabilities in Apache Struts 2.0.0 through 2.3.15 allow remote attackers to redirect users to

CVE-2018-11784 MEDIUM POC
4.3 Oct 04

When the default servlet in Apache Tomcat versions 9.0.0.M1 to 9.0.11, 8.5.0 to 8.5.33 and 7.0.23 to 7.0.90 returned a r

CVE-2022-45402 MEDIUM
6.1 Nov 15

In Apache Airflow versions prior to 2.4.3, there was an open redirect in the webserver's `/login` endpoint. Rated medium

CVE-2012-6499 MEDIUM POC
5.8 Jan 12

Open redirect vulnerability in age-verification.php in the Age Verification plugin 0.4 and earlier for WordPress allows

CVE-2015-2863 MEDIUM POC
4.3 Jul 20

Open redirect vulnerability in Kaseya Virtual System Administrator (VSA) 7.x before 7.0.0.29, 8.x before 8.0.0.18, 9.0 b

CVE-2017-3528 MEDIUM POC
5.4 Apr 24

Vulnerability in the Oracle Applications Framework component of Oracle E-Business Suite (subcomponent: Popup windows (li

CVE-2012-0518 MEDIUM
4.7 Oct 16

Unspecified vulnerability in the Oracle Application Server Single Sign-On component in Oracle Fusion Middleware 10.1.4.3

CVE-2024-21641 MEDIUM POC
6.5 Jan 05

Flarum is open source discussion platform software. Rated medium severity (CVSS 6.5), this vulnerability is remotely exp

CVE-2015-5354 MEDIUM POC
5.8 Jul 01

Open redirect vulnerability in Novius OS 5.0.1 (Elche) allows remote attackers to redirect users to arbitrary web sites

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Server 16.1 Affected
SUSE Linux Enterprise Server for SAP applications 16.1 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP5 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP6 Affected
openSUSE Leap 15.5 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy