Summary
CVE-2026-52813 is a critical path traversal vulnerability (CWE-23) in Gogs, the open-source self-hosted Git service, affecting all versions prior to 0.14.3. Because Gogs fails to sanitize organization names before using them to construct filesystem paths, an attacker can write repository data to arbitrary locations on the server and overwrite Git hook scripts in other repositories, resulting in Remote Code Execution (RCE). The vulnerability carries a CVSS v3.1 base score of 10.0 (Critical).
Technical details
- Root cause: The function
os.MkdirAll(repox.UserPath(org.Name))ininternal/database/org.gopasses the attacker-controlled organization name directly into a filesystem path construction without neutralizing directory traversal sequences (../). This allows repository directories to be created at arbitrary locations outside the intended data directory. - Trigger conditions: An attacker registers an organization with a crafted name containing path traversal sequences (e.g.,
../../../../data/gogs/data/tmp/local-r/{ID}/nested) and creates a repository within it. This places the new repository’s directory structure inside the working tree of an existing, legitimate repository on the same server. - Attack vector: The attacker then modifies the nested repository’s
hooks/updatefile to contain arbitrary shell commands. Any subsequent interaction that triggers the overwritten Git hook (such as a push to the target repository) causes those commands to execute as thegituser. - Impact: Full Remote Code Execution as the
gituser — compromising all hosted repository data, configuration files, and potentially enabling further lateral movement within the host system. All three pillars of confidentiality, integrity, and availability are fully compromised (scored High/High/High with Changed scope). - Authentication: While the attack requires a registered Gogs user account, Gogs enables open self-registration by default, making this vulnerability effectively exploitable by any unauthenticated internet user on default-configured instances. NVD rates Privileges Required as None.
Affected software
- Gogs — all versions prior to 0.14.3
Severity
- CVSS v3.1 Base Score: 10.0 (Critical)
- Vector String:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H - CWE: CWE-23 (Relative Path Traversal)
Mitigation and recommended actions
- Immediate action: Upgrade to Gogs 0.14.3 or later, which contains the vendor-provided fix (pull request #8334, commit
f6acd46). - If immediate patching is not possible:
- Restrict Gogs access to trusted internal networks and block public self-registration via the
DISABLE_REGISTRATIONsetting inapp.inito eliminate unauthenticated exploitation paths. - Review existing organization names for any containing
../sequences and remove or rename them immediately. - Monitor Git hook files across hosted repositories for unexpected modifications.
- Restrict Gogs access to trusted internal networks and block public self-registration via the
IONIX Status
The IONIX research team is tracking ongoing exploitation attempts and recommends immediate patching. Potentially affected assets are outlined in this post.

