All vulnerabilities

Servers and applications

CVE-2026-52811

UploadRepoFiles writes outside repo working tree via committed parent sym

Severity
Critical 9.0
Published
19 Jun 2026
Last changed
3 Nov 2026
Added to UpHeron
3 Nov 2026
Fixed in
0.14.3
Exploit chance
0.5% in the next 30 daysHigher than 41% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
Path traversal (CWE-22)Link following (CWE-59)CWE-61
Attack
Over the network · Only under certain conditions · Needs a user account · No user action needed
Attacker can
Read data · Change data · Take it down
CVSS 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
Also known as
GHSA-89mr-xqfv-758m
Sources
CVE Program, Project advisories (GitHub)

Description

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 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 .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…

From gogs/gogs's security advisory. Shortened; the full text is there.

Affected software

SoftwareAffected versions
GogsServers and applications · cna:gogs|gogs
  • Every version before 0.14.3
GogsServers and applications · github:gogs/gogs
  • Every version before 0.14.3

About Gogs

free forge based on Git written in Go

From Wikidata, CC0 1.0.
Docker Hub pulls
94,040,857Docker Hub, 15 Nov 2026
GitHub stars
47,939GitHub, 15 Nov 2026
Forks
5,082GitHub, 15 Nov 2026
Latest release
v0.14.4GitHub, 15 Nov 2026
Released
12 Nov 2026GitHub
Developer
FLOSS contributorWikidata
License
Expat licenseWikidata
Written in
Go, Cascading Style Sheets, JavaScriptWikidata
First released
11 Feb 2014Wikidata
First published on GitHub
12 Feb 2014GitHub

References