Arbitrary file deletion via path traversal in Gogs wiki updateWikiPage (old_title)
In Gogs (self-hosted Git service) versions 0.13.3 and earlier, the wiki update/rename flow contains a path traversal flaw in the updateWikiPage function. An authenticated user with write access to a repository’s wiki can manipulate the old_title parameter in the wiki editing/rename form to traverse outside the intended wiki directory. The server then resolves the attacker-influenced path (with a .md suffix appended) and deletes it via os.Remove, enabling deletion of arbitrary server-side files reachable by traversal that match the effective target naming (i.e., with .md appended). The issue is fixed in 0.13.4 and 0.14.0+dev.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
Arbitrary deletion of server-side files (constrained by the application appending a .md extension), leading to data loss and denial of service. This can include deletion of wiki pages and other critical Markdown files on the host, potentially disrupting service operation and/or destroying important documentation/content.
If you can’t patch tonight, do this now.
Until patched, restrict wiki write access to trusted users only. Monitor and alert on wiki edit/rename requests containing traversal sequences in old_title (e.g., "../"). If feasible, disable the wiki feature to remove the vulnerable attack surface.
Patch, then assume compromise.
Upgrade Gogs to 0.13.4 or later (or 0.14.0+dev). Ensure old_title is sanitized/normalized before being used in path construction and deletion (e.g., apply the same canonicalization used for new titles such as ToWikiPageName, and/or enforce path.Clean plus strict basename/allowlist validation) prior to path.Join and os.Remove.
No validated public exploits yet. Hidden: 1 rejected by Mallory's analysis as not a working exploit.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
2 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.