Security Digest · Vulnerability record

CVE-2026-52811: Gogs: UploadRepoFiles writes outside repo working tree via committed parent sym

Gogs is an open source self-hosted Git service.

CVSS 9.0 Critical EPSS 0.5% · p40

Should you act?

Critical, preconditions apply

Severe if exploited, but exploitation needs conditions that may not apply to you. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.

  • No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
  • EPSS 0.5%, percentile 40: FIRST’s model estimates a 0.5% chance of exploitation activity in the next 30 days, higher than 40% of all scored CVEs (low). EPSS is a probability, not a verdict.
  • Needs an account (low (any account)). Exposure depends on who can log in.
  • Only applies if your dependency tree includes gogs.io/gogs (Go) < 0.14.3, fixed in 0.14.3. Check your lockfile, including transitive dependencies.

What it is

Gogs is an open source self-hosted Git service. Prior to 0.14.3, (Repository).UploadRepoFiles checks for symlinks only on the leaf of the upload target (osx.IsSymlink(targetPath)). The siblings UpdateRepoFile, DeleteRepoFile, and GetDiffPreview use hasSymlinkInPath, which lstats every component — UploadRepoFiles is the lone outlier. An attacker with repo-write access plus a multipart upload whose filename contains a literal backslash (preserved by filepath.Base on Linux, then converted to / by pathx.Clean) redirects the write through a previously-committed directory symlink. iox.CopyFile opens the destination with os.Create (no ONOFOLLOW), so the kernel follows the parent symlink and writes attacker bytes anywhere the gogs UID can write — ~git/.ssh/authorizedkeys → SSH foothold, or .git/hooks/post-receive → next-push RCE. This vulnerability is fixed in 0.14.3.

From the GitHub advisory

Summary

(Repository).UploadRepoFiles checks for symlinks only on the leaf of the upload target (osx.IsSymlink(targetPath)). The siblings UpdateRepoFile, DeleteRepoFile, and GetDiffPreview use hasSymlinkInPath, which lstats every component — UploadRepoFiles is the lone outlier. An attacker with repo-write access plus a multipart upload whose filename contains a literal backslash (preserved by filepath.Base on Linux, then converted to / by pathx.Clean) redirects the write through a previously-committed directory symlink. iox.CopyFile opens the destination with os.Create (no ONOFOLLOW), so the kernel follows the parent symlink and writes attacker bytes anywhere the gogs UID can write — ~git/.ssh/authorizedkeys → SSH foothold, or .git/hooks/post-receive → next-push RCE.

Windows builds are unaffected: filepath.Base treats \ as a separator (strips the multi-segment trick) and git defaults core.symlinks=false at checkout (committed mode-120000 entries become text files, not real symlinks). Details

The asymmetric check at internal/database/repoeditor.go:601-612:

vs. UpdateRepoFile's correct walker at internal/database/repoeditor.go:163:

Weakness type: CWE-22, CWE-59, CWE-61.

Product: gogs.io/gogs (Go) · Assigned by: GitHub_M · Published: 2026-06-24

Affected and fixed versions

EcosystemPackageVulnerableFirst fixed
Gogogs.io/gogs< 0.14.30.14.3
VendorProductAffected versions (per CVE record)
gogsgogs< 0.14.3

Severity scores

Scored byCVSSScoreVector
GitHub_M4.09 CriticalCVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
GitHub4.09.0 CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
  • Attack vector: network (remotely reachable)
  • Attack complexity: low
  • Attack requirements: present (depends on deployment conditions)
  • Privileges required: low (any account)
  • User interaction: none

CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.

Exploitation and urgency

  • CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
  • CISA SSVC assessment: exploitation none, automatable no, technical impact total.
  • FIRST EPSS (model of 2026-10-21): 0.47% probability of exploitation activity in the next 30 days; percentile 40.

Timeline

  • — GitHub-reviewed advisory GHSA-89mr-xqfv-758m published (critical)
  • — CVE record published by GitHub_M
  • — CVE record last updated

Sources and references

Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.

Vulnerability records

  1. GitHub Advisory GHSA-89mr-xqfv-758m github.com
  2. CVE.org record CVE-2026-52811 cve.org
  3. NVD entry CVE-2026-52811 nvd.nist.gov

Other references from the CVE record and advisory

  1. github.com github.com
  2. github.com github.com
  3. github.com github.com
  4. github.com github.com

Critical Go advisories · Today’s Security Digest