CVE-2026-52797: Gogs Path Traversal Arbitrary File Write – High Severity Update
Gogs, a self-hosted Git platform, contains a path traversal vulnerability affecting versions before 0.14.0. An authenticated user can manipulate input passed to the git diff command to write comparison results to arbitrary file locations outside the intended repository directory. This allows an attacker with valid credentials to overwrite or create files on the server, potentially compromising system integrity and availability.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 8.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:H
- Weaknesses (CWE)
- CWE-22
- 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.0, as an authorized user, an intruder can dictate the value which is passed to the git diff command which, together with bypassing the filtering of the passed value, allows the user to bypass the target directory and write the result of the comparison to any arbitrary path. This vulnerability is fixed in 0.14.0.
2 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability stems from insufficient input validation and filtering in Gogs' handling of git diff command parameters. Prior to version 0.14.0, the application fails to properly sanitize user-supplied values that are passed directly to git diff operations. An authenticated attacker can exploit CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) by crafting malicious input that bypasses path restrictions, enabling arbitrary file writes outside the target directory. The git diff command then executes with attacker-controlled paths, resulting in files being written to unintended locations on the filesystem.
Business impact
Successful exploitation enables authenticated attackers to degrade or destroy system availability by filling disks or overwriting critical application files. An attacker could corrupt the Gogs installation, destroy user repositories, or modify configuration files—all without requiring elevated privileges. For organizations relying on Gogs for source code management, this threatens data integrity and operational continuity. The ability to write arbitrary files could also create stepping stones for further system compromise if sensitive configuration or application code is overwritten.
Affected systems
Gogs versions prior to 0.14.0 are vulnerable. The attack requires valid user credentials, limiting exposure to environments where authentication is enabled. Organizations running Gogs as a self-hosted Git service should immediately verify their installed version. The vulnerability does not affect systems already running Gogs 0.14.0 or later.
Exploitability
Exploitability is moderate to high in practice. The attack requires authentication (reducing the attack surface to authorized users or compromised accounts), but once inside, the exploit is straightforward—no complex interaction or unusual configuration is needed. The network-accessible nature of Gogs and the low complexity of crafting malicious diff parameters make this practical for motivated attackers with valid credentials. No user interaction is required once authenticated.
Remediation
Upgrade to Gogs version 0.14.0 or later. The fix introduces proper input validation and filtering for git diff parameters, preventing path traversal. Organizations should prioritize this upgrade immediately given the CVSS 8.5 (HIGH) severity rating and the ease of exploitation by authenticated users.
Patch guidance
Download and deploy Gogs 0.14.0 or a later stable release from the official Gogs repository. Before upgrading, back up your Gogs configuration, user data, and repositories. Test the upgrade in a non-production environment if possible to verify compatibility with your existing setup and any custom configurations. Perform a controlled rollout to production, and validate that all repositories and user accounts are accessible post-upgrade.
Detection guidance
Monitor logs for unusual git diff invocations or diff output being written to unexpected paths outside repository directories. Watch for filesystem write attempts in suspicious locations from the Gogs application process. Audit user accounts with Git access to identify if any have performed anomalous operations. Consider deploying file integrity monitoring on critical directories to detect unauthorized file modifications. Review Gogs access logs for activity from lesser-known accounts or unusual patterns of repository access.
Why prioritize this
This vulnerability merits urgent prioritization. Although it requires authentication, the CVSS 8.5 score reflects the significant availability and integrity impact. The ease of exploitation and broad potential for filesystem damage—disk saturation, configuration corruption, or repository destruction—makes this a critical security gap. Any organization running Gogs should treat patching as essential. The vulnerability is particularly concerning in multi-tenant environments or organizations with high-risk user populations where account compromise is a realistic threat.
Risk score, explained
The CVSS 8.5 (HIGH) score reflects: (1) network accessibility and low attack complexity once authenticated; (2) privilege escalation in scope (an authenticated user can affect system availability and integrity); (3) high availability impact (attackers can write large files or corrupt critical files, causing denial of service); (4) low confidentiality impact (direct data exfiltration is not the primary concern); (5) low integrity impact in the CVSS model, though practical impact is significant (file overwrite/creation). The requirement for prior authentication (PR:L) prevents a critical rating, but the broad damage potential justifies the HIGH severity classification.
Frequently asked questions
Do I need to upgrade immediately if we restrict Gogs access to trusted internal users?
Yes. While trusted users reduce risk, account compromise remains a realistic threat, and any authenticated user can exploit this. Additionally, insider threats are a genuine concern. Upgrade as soon as feasible rather than relying solely on access controls.
Can an attacker write arbitrary code or execute commands directly via this vulnerability?
No. The vulnerability allows writing files to arbitrary paths on the filesystem, but it does not directly enable code execution. However, an attacker could overwrite application files or configuration to achieve code execution in a secondary attack step.
Is there a workaround if I cannot patch immediately?
The primary mitigation is upgrading to 0.14.0. If upgrade is temporarily blocked, restrict Gogs access to only essential, highly-trusted users, disable external access if possible, and monitor filesystem activity closely. These are interim measures only—patching should be completed urgently.
What should I check after upgrading to 0.14.0?
Verify all repositories are intact and accessible, confirm user authentication still functions, and test git diff operations to ensure normal workflow is not disrupted. Check for any unusual files that may have been created in unexpected locations during the vulnerability window, and review audit logs for suspicious activity patterns.
This analysis is provided for informational purposes and should not be treated as legal or compliance advice. Organizations must verify all information against official Gogs security advisories and their own environment configurations. The CVSS score, affected versions, and patch details referenced are based on source data current as of the publication date; verify patch version numbers and compatibility against the official Gogs project before deploying. Exploitation requires valid authentication credentials; organizations should also assess credential compromise risk within their threat model. This report does not constitute a vulnerability disclosure in the security research sense and is intended as defensive guidance for system administrators and security teams. Source: NVD (public-domain), retrieved 2026-08-02. Analysis generated by SEC.co (claude-haiku-4-5).
Weaknesses (CWE)
Related vulnerabilities
- CVE-2016-20076HIGHWordPress Simple-Backup 2.7.11 Unauthenticated File Access & Deletion Vulnerability
- CVE-2016-20081HIGHHB Audio Gallery Lite Path Traversal Vulnerability – Unauthenticated File Download
- CVE-2017-20248HIGHApptha Slider Gallery Path Traversal Vulnerability
- CVE-2017-20250HIGHMac Photo Gallery 3.0 Path Traversal File Download Vulnerability
- CVE-2018-25408HIGHOpen ISES Project Path Traversal Vulnerability (High Severity)
- CVE-2024-32729HIGHPath Traversal in QuantumCloud Conversational Forms for ChatBot (CVSS 7.5)
- CVE-2024-40646HIGHVertex Path Traversal Vulnerability – Remote File Access Risk
- CVE-2025-60223HIGHWPBot Pro Arbitrary File Deletion Vulnerability – HIGH Risk Exploit