{"id":"CVE-2026-52811","published":"2026-06-24T20:31:38Z","modified":"2026-11-03T22:13:27Z","title":"Gogs: UploadRepoFiles writes outside repo working tree via committed parent sym","vendor":"gogs","product":"gogs","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":9,"severity":"CRITICAL","version":"4.0","vector":"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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00474,"percentile":0.41893,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"},{"id":"CWE-59","name":"Improper Link Resolution Before File Access"},{"id":"CWE-61","name":"UNIX Symbolic Link (Symlink) Following"}],"references":[{"url":"https://github.com/gogs/gogs/security/advisories/GHSA-89mr-xqfv-758m","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/gogs/gogs/pull/8332","tags":["x_refsource_MISC"]},{"url":"https://github.com/gogs/gogs/commit/04cb8afbb01d855454e59977a1cdbf522ea1db31","tags":["x_refsource_MISC"]},{"url":"https://github.com/gogs/gogs/releases/tag/v0.14.3","tags":["x_refsource_MISC"]}],"priority":{"score":14.7,"factors":[{"name":"EPSS percentile","points":8.38},{"name":"CVSS severity","points":6.3}]},"vendorSlug":"gogs","affectedVersions":[{"vendor":"gogs","product":"gogs","versions":["< 0.14.3"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-06-26T03:55:40.649803Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Go","package":"gogs.io/gogs","vulnerableRanges":["<0.14.3","all versions"],"patched":["0.14.3"],"from":["GHSA-89mr-xqfv-758m","GO-2026-5249"],"provenance":"source"}],"summary":{"text":"In Gogs, the UploadRepoFiles function checks only the final path component for symlinks, unlike sibling functions that check every path component, so a committed directory symlink in a parent path is not detected. An attacker with repository write access who can perform a multipart upload with a crafted filename containing a backslash can write attacker-controlled bytes through that symlink to arbitrary locations writable by the Gogs user, without requiring any further authentication beyond that repository write access.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:31:13Z"},"euvd":{"id":"EUVD-2026-39082","exploited":false,"provenance":"source"}}