Junglewise Threat Intelligence

CVE-2026-52813: Gogs path traversal and RCE via organization names

CVE-2026-52813 · Severity: critical · CVSS 10 · Published 2026-06-24

Technologies: gogs.io/gogs (Go), Gogs. Vendors: Go, Gogs.

Executive brief

Gogs is an open-source self-hosted Git service used by teams to manage source code. A critical vulnerability allows attackers to create organizations with malicious names that trick the server into saving data in unintended locations on the host system. By manipulating these file paths, an attacker can overwrite internal configuration files and execute arbitrary commands on the server, potentially leading to a full system takeover and theft of all hosted source code.

Technical details

A path traversal vulnerability (CWE-23) exists in Gogs' organization creation API. The application fails to sanitize organization names, allowing sequences like '../' to be used. Because organization and repository names are used to construct filesystem paths via 'repox.UserPath' and 'repox.RepositoryPath', an attacker can place Git repositories at arbitrary locations. By strategically nesting a repository within the local worktree of another repository, an attacker can overwrite Git hooks (such as 'hooks/update'). When the repository is subsequently interacted with, the malicious hook is executed, resulting in Remote Code Execution (RCE) with the privileges of the Gogs process. This is fixed in version 0.14.3 by implementing 'AlphaDashDot' validation on organization names and using 'pathx.Clean' on filesystem path inputs.

Affected products

  • Gogs Gogs < 0.14.3

Timeline

  • 2026-06-07: patched: Fix merged in PR #8334 and released in v0.14.3
  • 2026-06-19: advisory: GitHub Security Advisory GHSA-c39w-43gm-34h5 published
  • 2026-06-24: disclosed: CVE-2026-52813 published to NVD

References

Related threats