CVE-2026-52811
Gogs: UploadRepoFiles writes outside repo working tree via committed parent sym
- Published
- Updated
- Reserved
- Assigned by
- GitHub_M
Description
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 O_NOFOLLOW), so the kernel follows the parent symlink and writes attacker bytes anywhere the gogs UID can write — ~git/.ssh/authorized_keys → SSH foothold, or <repo>.git/hooks/post-receive → next-push RCE. This vulnerability is fixed in 0.14.3.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_MCNA (assigner) | 4.0 | Critical9.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 |
| NVDNVD · Deferred | 4.0 | Critical9.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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
- EPSS (exploitation in 30 days)
- 0.47% · top 59% of all CVEs (6 Nov 2026)
- CISA SSVC
- Exploitation: none · Automatable: no · Technical impact: total
The list uses the assigner's score when there is one, then CISA's, then NVD's: Critical 9.0.
Weakness
- CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (opens in a new tab)All about CWE-22 and its CVEs
- CWE-59: Improper Link Resolution Before File Access ('Link Following') (opens in a new tab)All about CWE-59 and its CVEs
- CWE-61: UNIX Symbolic Link (Symlink) Following (opens in a new tab)All about CWE-61 and its CVEs
Affected products
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- Gogogs.io/gogsGHSA-89mr-xqfv-758m (opens in a new tab)
References (4)
- https://github.com/gogs/gogs/security/advisories/GHSA-89mr-xqfv-758m (opens in a new tab)x_refsource_CONFIRMexploit
- https://github.com/gogs/gogs/pull/8332 (opens in a new tab)x_refsource_MISC
- https://github.com/gogs/gogs/commit/04cb8afbb01d855454e59977a1cdbf522ea1db31 (opens in a new tab)x_refsource_MISC
- https://github.com/gogs/gogs/releases/tag/v0.14.3 (opens in a new tab)x_refsource_MISC
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-89mr-xqfv-758m (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://trackcve.app/cve/CVE-2026-52811)Record last updated .