{"id":"CVE-2026-24135","aliases":["CVE-2026-24135","GHSA-jp7c-wj6q-3qf2","GO-2026-4452"],"related":[],"kind":"vulnerability","state":"published","title":"Gogs vulnerable to arbitrary file deletion via path traversal in wiki page update","summary":"Gogs is an open source self-hosted Git service. In version 0.13.3 and prior, a path traversal vulnerability exists in the updateWikiPage function of Gogs. The vulnerability allows an authenticated user with write access to a repository's wiki to delete arbitrary files on the server by manipulating the old_title parameter in the wiki editing form. This issue has been patched in versions 0.13.4 and 0.14.0+dev.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Gogs is an open source self-hosted Git service. In version 0.13.3 and prior, a path traversal vulnerability exists in the updateWikiPage function of Gogs. The vulnerability allows an authenticated user with write access to a repository's wiki to delete arbitrary files on the server by manipulating the old_title parameter in the wiki editing form. This issue has been patched in versions 0.13.4 and 0.14.0+dev.","source":"cvelist"},{"lang":"en","text":"### Summary\nA Path Traversal vulnerability exists in the `updateWikiPage` function of Gogs. The vulnerability allows an authenticated user with write access to a repository's wiki to delete arbitrary files on the server by manipulating the `old_title` parameter in the wiki editing form.\n\n### Vulnerability Deatils\nThe vulnerability is located in `internal/database/wiki.go`. When updating a wiki page, the application accepts an `old_title` parameter to identify the potential rename operation. This parameter is used directly in `path.Join` and `os.Remove` without proper sanitization.\n\nCode snippet from `internal/database/wiki.go`:\n```go\n// Line 114\nos.Remove(path.Join(localPath, oldTitle+\".md\"))\n```\n\nIf an attacker provides a path traversal sequence (e.g., `../../../../target`) as `old_title`, the `os.Remove` function will resolve the path relative to the wiki's local directory and delete the target file. The vulnerability is limited to deleting files that end with `.md` (due to the appended extension), but depending on the filesystem and specific `path.Join` behavior, or if critical `.md` files exist (e.g. documentation, other wikis), the impact is significant. Additionally, in some contexts, the extension might be bypassed or ignored.\n\n### Impact\n- **Denial of Service**: Deletion of critical configuration files or data (if they match the extension or via other tricks).\n- **Data Loss**: Deletion of other users' wiki pages or documentation.\n\n### Remediation\nSanitize the `oldTitle` parameter using `ToWikiPageName` (or `path.Clean` and basename validation) before using it in file operations, similar to how the new `title` is currently handled.\n\n```go\n// Recommended Fix\nif oldTitle != \"\" {\n    oldTitle = ToWikiPageName(oldTitle)\n}\n```\n\n### Reproduction Steps\n1.  Log in to Gogs as a user with write access to a repository wiki.\n2.  Intercept the `POST` request to `/repo/wiki/edit`.\n3.  Modify the `old_title` parameter to `../../../../tmp/target_file`.\n4.  Submit the request.\n5.  Observe that `/tmp/target_file.md` is deleted from the server.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Gogs vulnerable to arbitrary file deletion via Path Traversal in wiki page update in gogs.io/gogs.\n\nNOTE: The source advisory for this report contains additional versions that could not be automatically mapped to standard Go module versions.\n\n(If this is causing false-positive reports from vulnerability scanners, please suggest an edit to the report.)\n\nThe additional affected modules and versions are: gogs.io/gogs before v0.13.4.","format":"markdown","source":"go"},{"lang":"es","text":"Gogs es un servicio Git de código abierto autoalojado. En la versión 0.13.3 y anteriores, existe una vulnerabilidad de salto de ruta en la función updateWikiPage de Gogs. La vulnerabilidad permite a un usuario autenticado con acceso de escritura a la wiki de un repositorio eliminar archivos arbitrarios en el servidor manipulando el parámetro old_title en el formulario de edición de la wiki. Este problema ha sido parcheado en las versiones 0.13.4 y 0.14.0+dev.","source":"nvd"}],"published":"2026-02-06T17:47:49.935Z","modified":"2026-06-17T10:22:41.367Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N","score":7.2,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N","score":7.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","score":8.1,"rating":"HIGH"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 0.14.0+dev","status":"affected"},{"version":"< 0.13.4","status":"affected"}],"vendor":"gogs","product":"gogs","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.13.4"}],"ecosystem":"Go","package":"gogs.io/gogs","purl":"pkg:golang/gogs.io/gogs","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"gogs.io/gogs","purl":"pkg:golang/gogs.io/gogs","source":"go"},{"ranges":[{"status":"affected","fixed":"0.13.4"}],"vendor":"gogs","product":"gogs","cpe":"cpe:2.3:a:gogs:gogs:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/gogs/gogs/security/advisories/GHSA-jp7c-wj6q-3qf2","tags":["advisory","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-24135","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/gogs/gogs","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-02-06T18:08:01.081Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-24135","url":"https://www.cve.org/CVERecord?id=CVE-2026-24135","licence":"CVE Terms of Use","modified":"2026-02-06T18:08:28.398Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-jp7c-wj6q-3qf2","url":"https://github.com/advisories/GHSA-jp7c-wj6q-3qf2","licence":"CC-BY-4.0","modified":"2026-02-19T20:40:59.281Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4452","url":"https://pkg.go.dev/vuln/GO-2026-4452","licence":"CC-BY-4.0","modified":"2026-02-19T20:40:59.281Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-24135","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-24135","licence":"Public domain","modified":"2026-06-17T10:22:41.367Z"}],"updatedAt":"2026-11-25T22:59:13.559Z","epss":{"score":0.00963,"percentile":0.62648,"date":"2026-12-01T12:00:22.000Z"}}