CVE-2026-52811: Gogs arbitrary file write via symlink following in UploadRepoFiles

CVE-2026-52811 · Severity: critical · CVSS 4 · Published 2026-06-24

Gogs is an open-source self-hosted Git service used by organizations to manage source code. A vulnerability in the file upload system allows an attacker with repository write access to bypass security restrictions and write files anywhere on the server's filesystem that the Gogs service can access. This could lead to a complete takeover of the server, unauthorized access to other repositories, or persistent remote access via SSH.

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

Quick answers

Is CVE-2026-52811 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-52811 being exploited in the wild.
How severe is CVE-2026-52811?
Critical severity, with a CVSS score of 4, 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-52811?
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-52811 attacked?
It is attacked over the network, in a network appliance.
Am I affected by CVE-2026-52811?
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
    go get gogs.io/gogs@v0.14.3

Technical details

A path traversal and symlink following vulnerability exists in Gogs' UploadRepoFiles handler. While other file operations in Gogs use a 'hasSymlinkInPath' check to validate every component of a path, UploadRepoFiles only checks if the final leaf is a symlink. An attacker with repository write access can commit a directory symlink, then perform a multipart upload with a filename containing a literal backslash. On Linux, this backslash is preserved by filepath.Base but later converted to a forward slash by pathx.Clean, allowing the upload to be routed through the previously committed symlink. Because iox.CopyFile uses os.Create without O_NOFOLLOW, the kernel follows the symlink, allowing the attacker to overwrite sensitive files like .ssh/authorized_keys or git hooks. This issue is fixed in version 0.14.3.

Affected products

  • Gogs Gogs < 0.14.3

Identifiers

  • CVE-2026-52811
  • GHSA-89mr-xqfv-758m
  • GO-2026-5249

Timeline

  • 2026-06-07: patched: Fix merged into main branch and released in v0.14.3
  • 2026-06-19: advisory: GitHub Security Advisory GHSA-89mr-xqfv-758m published
  • 2026-06-24: disclosed: CVE-2026-52811 published to NVD

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.