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

- Severity: Critical 9.0 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.46%, higher than 41% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-06-23T17:09:55.000Z
- Modified: 2026-11-03T23:17:47.817Z
- Also known as: GHSA-89mr-xqfv-758m, GO-2026-5249
- Weaknesses: CWE-22, CWE-59, CWE-61
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- 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.

(As written by CVE List.)

## Affected

- gogs gogs: < 0.14.3
- gogs.io/gogs (Go): before 0.14.3; all versions

## Every score

- GitHub_M: CVSS:4.0 9.0 Critical `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`
- GitHub: CVSS:4.0 Critical `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`

## References

- <https://github.com/gogs/gogs/security/advisories/GHSA-89mr-xqfv-758m> (exploit, advisory, web)
- <https://github.com/gogs/gogs/pull/8332> (web)
- <https://github.com/gogs/gogs/commit/04cb8afbb01d855454e59977a1cdbf522ea1db31> (web)
- <https://github.com/gogs/gogs/releases/tag/v0.14.3> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-52811> (advisory)
- <https://github.com/gogs/gogs> (package)

## Sources

- CVE List: [CVE-2026-52811](https://www.cve.org/CVERecord?id=CVE-2026-52811), CVE Terms of Use, modified 2026-11-03
- GitHub Advisory Database: [GHSA-89mr-xqfv-758m](https://github.com/advisories/GHSA-89mr-xqfv-758m), CC-BY-4.0, modified 2026-07-21
- Go Vulnerability Database: [GO-2026-5249](https://pkg.go.dev/vuln/GO-2026-5249), CC-BY-4.0, modified 2026-06-25
- NVD: [CVE-2026-52811](https://nvd.nist.gov/vuln/detail/CVE-2026-52811), Public domain, modified 2026-11-03

---

Page: https://cve.day/CVE-2026-52811 · Whole record: https://cve.day/CVE-2026-52811.json · Rebuilt by cve.day 2026-11-25T22:59:25.749Z
