CVE-2026-52802: Gogs.io/gogs Gogs Has An Open Redirect Vulnerability
MODERATECVE-2026-52802 is a MODERATE (CVSS 5.4) gogs has an open redirect vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Gogs.io/gogs libraries in the Go ecosystem. The issue involves gogs has an open redirect via redirect_to. Remediation is available by upgrading affected packages to version 0.14.3.
CVE-2026-52802 at a Glance
Security Impact
CVSS: 5.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N).
How to Fix CVE-2026-52802
To remediate this vulnerability, upgrade all affected Gogs.io/gogs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade gogs.io/gogs to 0.14.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for gogs.io/gogs
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-52802, inspect your project dependencies for Gogs.io/gogs:
inspect dependencies for gogs.io/gogs
Analyze the terminal output to locate any version of Gogs.io/gogs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.14.3), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Gogs.io/gogs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-52802 Affected Gogs.io/gogs Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
gogs.io/gogs
|
Go |
< 0.14.3
|
0.14.3
|
References
Frequently Asked Questions
What is CVE-2026-52802?
Which Gogs.io/gogs versions are affected?
What version fixes CVE-2026-52802?
Is gogs.io/gogs affected?
What is the CVSS score of CVE-2026-52802?
What CWE is associated with CVE-2026-52802?
How can I check Go dependencies for CVE-2026-52802?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xxhq-69mf-w8cr",
"modified" : "2026-07-21T13:36:21Z",
"published" : "2026-06-23T16:42:02Z",
"aliases" : [ "CVE-2026-52802" ],
"summary" : "Gogs has an Open Redirect via redirect_to",
"details" : "### Summary\nAn open redirect vulnerability exists in Gogs where attacker-controlled `redirect_to` parameters can bypass validation, allowing redirection to arbitrary external sites.\n\n\n### Details\nAll redirects in Gogs that are validated via the `IsSameSite` function are vulnerable:\n```go\nfunc IsSameSite(url string) bool {\n return len(url) >= 2 && url[0] == '/' && url[1] != '/' && url[1] != '\\\\'\n}\n```\n\nThe 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:\n```\n/a/../\\example.com\n```\n\nThe `IsSameSite` function checks the input supplied to the `redirect_to` query parameter value `/a/../\\example.com` and considers it valid.\n\nBecause web browsers normalize backslashes `\\` to forward slashes `/`, the normalized URL becomes `//example.com`.\n\nThe normalized URL becomes:\n```\n//example.com\n```\n\nResulting in a cross-origin redirect.\n\nThis affects all endpoints using the `redirect_to` query parameter, including login and other post-action flows.\n\n\n### PoC\n\n1. 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:\n```\nhttp://192.168.236.132:3000/user/login?redirect_to=/a/../\\example.com\n```\n\n<img width=\"1339\" height=\"536\" alt=\"image\" src=\"https://github.com/user-attachments/assets/3c2a13b8-f0b7-42c2-a223-6f0ebf083589\" /> \n\n<br>\n<br>\n\n2. After the user successfully logs in, they would be redirected to the site an attacker wants them to visit:\n\n<img width=\"1066\" height=\"463\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1726a3d9-6705-43cc-bdd2-90aad105d021\" />\n\n<img width=\"1097\" height=\"396\" alt=\"image\" src=\"https://github.com/user-attachments/assets/376052f5-0e00-4d14-a548-fa75a6269530\" />\n\n\n### Impact\n* Phishing: Attackers can use trusted domain links to redirect victims to credential-harvesting pages\n* OAuth/SSO Token Theft: In authentication flows, authorization codes or tokens may leak via redirect\n* Referer Leakage: Sensitive URL parameters may be exposed to attacker domains via the Referer header\n* Cache Poisoning: In deployments with shared caches, malicious redirects may be cached and served to other users",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "gogs.io/gogs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.14.3"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.14.2"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/gogs/gogs/security/advisories/GHSA-xxhq-69mf-w8cr"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-52802"
}, {
"type" : "WEB",
"url" : "https://github.com/gogs/gogs/pull/8322"
}, {
"type" : "WEB",
"url" : "https://github.com/gogs/gogs/commit/c5da9631dc75f692f313373ae229c4d47ba6517f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/gogs/gogs"
}, {
"type" : "WEB",
"url" : "https://github.com/gogs/gogs/releases/tag/v0.14.3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-601" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-23T16:42:02Z",
"nvd_published_at" : "2026-06-24T21:16:56Z"
}
}