MEDIUM 5.4

CVE-2026-52802: Gogs Open Redirect Vulnerability (v0.14.2 and Earlier)

Gogs, a self-hosted Git service, contains an open redirect vulnerability that allows attackers to trick users into visiting arbitrary external websites. The vulnerability exists because Gogs' validation function checks only the first two characters of a URL, missing a technique where directory traversal sequences followed by backslashes can bypass the security check. An attacker would need to social-engineer a user into clicking a malicious link, but once clicked, the user is silently redirected off the Gogs platform. This issue is resolved in version 0.14.3 and later.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.4 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Weaknesses (CWE)
CWE-601
Affected products
0 configuration(s)
Published / Modified
2026-06-24 / 2026-06-25

NVD description (verbatim)

Gogs is an open source self-hosted Git service. Prior to 0.14.3, an open redirect vulnerability exists in Gogs where attacker-controlled redirect_to parameters can bypass validation, allowing redirection to arbitrary external sites. All redirects in Gogs that are validated via the IsSameSite function are vulnerable. The function only inspects the first two characters of the URL string. This check fails to account for directory traversal sequences followed by backslashes. This vulnerability is fixed in 0.14.3.

5 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-52802 is an open redirect vulnerability (CWE-601) in Gogs prior to version 0.14.3. The root cause is a flawed implementation of the IsSameSite validation function, which performs an insufficient check by only inspecting the first two characters of the redirect_to parameter. This allows attackers to craft URLs containing directory traversal sequences (such as '../' or '..\') followed by backslashes that evade validation logic, enabling redirection to attacker-controlled external domains. The vulnerability requires user interaction—a victim must click on or be redirected via a specially crafted link—but once triggered, the redirect occurs without additional security prompts.

Business impact

Open redirect vulnerabilities are commonly exploited in phishing and credential harvesting campaigns. An attacker can leverage a Gogs instance to create seemingly legitimate links that appear to direct users to internal resources but actually redirect them to lookalike login pages or malware distribution sites. For organizations self-hosting Gogs, this creates a trust problem: users may assume links from the Gogs interface are safe. The medium CVSS score (5.4) reflects the requirement for user interaction, but the reputational and phishing risk should not be underestimated, especially if the Gogs instance is used by a development team or hosts sensitive project links.

Affected systems

All Gogs instances running version 0.14.2 and earlier are affected. Self-hosted Gogs deployments in enterprises, open-source projects, or development teams are in scope. The vulnerability affects any functionality within Gogs that uses the IsSameSite function for redirect validation, meaning multiple redirect endpoints across the application are at risk, not just a single feature.

Exploitability

Exploitability is moderate. An attacker cannot directly force a redirect; user interaction is required. However, the attack surface is broad—any link within Gogs that performs a redirect is a potential vector. Attackers can embed malicious links in issue descriptions, pull request comments, commit messages, or other user-generated content within Gogs itself, leveraging the platform's own interface to distribute phishing links. The vulnerability does not require authentication, making it accessible to unauthenticated users if Gogs is configured with public repositories or accessible registration.

Remediation

Upgrade Gogs to version 0.14.3 or later immediately. This version includes a corrected IsSameSite validation function that properly handles directory traversal sequences and backslash evasion attempts. Verify the upgrade against the official Gogs release notes and repository to confirm the patch is applied. For organizations that cannot upgrade immediately, consider implementing a Web Application Firewall (WAF) rule to detect and block redirect_to parameters containing directory traversal patterns, and educate users about validating URLs before clicking links from Gogs.

Patch guidance

1. Review your current Gogs version via the admin console or by checking the installed release tag. 2. Back up your Gogs instance, including the database and repository data. 3. Follow the official Gogs upgrade documentation for your deployment method (binary, Docker, package manager, etc.). 4. Apply the upgrade to version 0.14.3 or later. 5. Test redirect functionality in your upgraded instance to ensure no regressions. 6. Monitor logs for any unusual redirect patterns post-upgrade. Verify against the vendor's release notes that the IsSameSite validation function has been patched.

Detection guidance

Monitor Gogs access logs for suspicious redirect_to parameters containing patterns like '../', '..\', or other directory traversal sequences. Look for log entries where the redirect destination differs significantly from the request origin. Additionally, track user reports of unexpected redirects or phishing-like behavior originating from Gogs links. If you operate a SIEM, create alerts for redirect_to parameters that fail to match your organization's expected redirect domains. Consider logging all redirect events at DEBUG level during the remediation window.

Why prioritize this

Although the CVSS score is medium (5.4), this vulnerability should be prioritized based on attack likelihood and user trust. Gogs instances hosting open-source or internal development projects are trusted channels; attackers can exploit that trust to launch convincing phishing campaigns. The ease of crafting a malicious redirect and the broad attack surface (many redirect endpoints) elevate practical risk. Patch this within your standard update cycle, and do not deprioritize based on the CVSS score alone.

Risk score, explained

The CVSS 3.1 score of 5.4 (MEDIUM) reflects a network-accessible vulnerability with low attack complexity and no privilege requirements, but it requires user interaction (clicking a link) and causes limited direct impact—the attacker gains only information disclosure or integrity issues on the user's endpoint (session hijacking, malware infection), not on the server itself. There is no availability impact. The score is accurate but somewhat conservative; the real-world risk is elevated by the reputational impact and the likelihood of social engineering within trusted development communities.

Frequently asked questions

Can an attacker exploit this vulnerability without user interaction?

No. The vulnerability requires a user to click on or be redirected via a malicious link. An attacker cannot remotely force a redirect on a Gogs user without some form of social engineering or link embedding in a web page the user visits.

Does this vulnerability allow an attacker to access private repositories or steal credentials directly from Gogs?

No. The vulnerability is limited to redirecting users away from Gogs to external sites. It does not grant access to the Gogs instance itself, private repositories, or user credentials stored in Gogs. However, an attacker could redirect a user to a phishing page designed to steal their credentials.

Are Gogs instances without public access affected?

Yes. If a Gogs instance is accessible to internal users or has any publicly accessible repositories, the vulnerability applies. The attacker's ability to embed malicious links depends on their access level, but the underlying validation flaw exists across all instances running vulnerable versions.

What does IsSameSite do, and why is checking only the first two characters insufficient?

IsSameSite is a validation function intended to ensure that redirects only target the same domain or trusted internal URLs. By checking only the first two characters, it fails to detect evasion techniques like '../../evil.com' or similar directory traversal tricks where the initial characters appear safe but the actual redirect target is external.

This analysis is based on publicly available information as of the publication date and represents the judgment of SEC.co analysts. No exploit code or detailed weaponization techniques are provided. Organizations should verify patch availability and compatibility with their deployment before applying updates. This content is for informational purposes and should not replace formal vulnerability assessment or risk management policies. Always test patches in a non-production environment first. Source: NVD (public-domain), retrieved 2026-08-02. Analysis generated by SEC.co (claude-haiku-4-5).