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

Source: https://junglewise.ai/threats/cve-2026-52813-gogs-path-traversal-and-rce-via-organization-names  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-24. Updated: 2026-06-24  
License: CC BY 4.0 with a link back

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

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.

Technologies: [gogs.io/gogs (Go)](https://junglewise.ai/threats/technologies/gogs-io-gogs), [Gogs](https://junglewise.ai/threats/technologies/gogs). Vendors: [Go](https://junglewise.ai/threats/vendors/go), [Gogs](https://junglewise.ai/threats/vendors/gogs).

## Quick answers

**Is CVE-2026-52813 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-52813 being exploited in the wild.

**How severe is CVE-2026-52813?** Critical severity, with a CVSS score of 10, published 24 June 2026.

**Which products and versions are affected?** gogs.io/gogs (Go) < 0.14.3, SEMVER:introduced=0, SEMVER:introduced=0,fixed=0.14.3; Gogs < 0.14.3.

**Is there a fix for CVE-2026-52813?** Yes. gogs.io/gogs (Go): upgrade to 0.14.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-52813 attacked?** It is attacked over the network, in a hosted service.

**Am I affected by CVE-2026-52813?** Check whether you run gogs.io/gogs (Go) or Gogs at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- gogs.io/gogs (Go): upgrade to 0.14.3 or later

  ```sh
  go get gogs.io/gogs@v0.14.3
  ```


## 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

## Identifiers

- CVE-2026-52813
- GHSA-c39w-43gm-34h5
- GO-2026-5305

## 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

- [https://github.com/gogs/gogs/commit/f6acd467305943aae8403cbac81f0118dd1235d7](https://github.com/gogs/gogs/commit/f6acd467305943aae8403cbac81f0118dd1235d7)
- [https://github.com/gogs/gogs/pull/8334](https://github.com/gogs/gogs/pull/8334)
- [https://github.com/gogs/gogs/releases/tag/v0.14.3](https://github.com/gogs/gogs/releases/tag/v0.14.3)
- [https://github.com/gogs/gogs/security/advisories/GHSA-c39w-43gm-34h5](https://github.com/gogs/gogs/security/advisories/GHSA-c39w-43gm-34h5)

## Related threats

- [Gogs Git Smart HTTP authorization bypass](https://junglewise.ai/threats/cve-2026-123012-in-gogs-0-14-3-the-git-smart-http-authorization-layer-in)
- [Gogs open redirect via backslash normalization mismatch](https://junglewise.ai/threats/cve-2026-82402-gogs-is-an-open-source-self-hosted-git-service-prior-to-0-15-0)
- [GO-2026-5193 - Gogs: XSS in .ipynb files renderer due to outdated notebookjs in gogs.io/gogs](https://junglewise.ai/threats/go-2026-5193-gogs-xss-in-ipynb-files-renderer-due-to-outdated-d1e8727f)
- [Gogs stored XSS in Jupyter Notebook sanitizer endpoint](https://junglewise.ai/threats/cve-2026-52816-gogs-stored-xss-in-jupyter-notebook-sanitizer-endpoint)
- [Gogs unauthenticated information disclosure in organization teams API](https://junglewise.ai/threats/cve-2026-52815-gogs-unauthenticated-information-disclosure-in-organization-teams)
