{"id":"CVE-2026-23633","aliases":["CVE-2026-23633","GHSA-mrph-w4hh-gx3g","GO-2026-4453"],"related":[],"kind":"vulnerability","state":"published","title":"Gogs has arbitrary file read/write via path traversal in Git hook editing","summary":"Gogs is an open source self-hosted Git service. In version 0.13.3 and prior, there is an arbitrary file read/write via path traversal in Git hook editing. 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, there is an arbitrary file read/write via path traversal in Git hook editing. This issue has been patched in versions 0.13.4 and 0.14.0+dev.","source":"cvelist"},{"lang":"en","text":"## Vulnerability Description\n\nIn the endpoint:\n\n```\n/username/reponame/settings/hooks/git/:name\n```\n\nthe `:name` parameter:\n\n* Is URL-decoded by **macaron routing**, allowing decoded slashes (`/`)\n* Is then passed directly to:\n\n```go\ngit.Repository.Hook(\"custom_hooks\", name)\n```\n\nwhich internally resolves the path as:\n\n```go\nfilepath.Join(repoPath, \"custom_hooks\", name)\n```\n\nBecause no path sanitization is applied, supplying `../` sequences allows access to **arbitrary paths outside the repository**.\n\n### As a Result:\n\n* **GET:** Arbitrary file contents are displayed in the hook edit page textarea (**Local File Inclusion**).\n* **POST:** Existing files can be overwritten with attacker-controlled content (**Arbitrary File Write**).\n\n---\n\n## Attack Prerequisites\n\n* The attacker is an authenticated user\n* The attacker has **Admin or higher privileges** on the target repository\n* The attacker has the **AllowGitHook** permission (or is a site administrator)\n* The target file is readable/writable by the **Gogs process OS permissions**\n\n---\n\n## Attack Scenario\n\n1. An attacker (with AllowGitHook + repository Admin privileges) accesses the Git hook edit URL\n2. A path containing `../` is supplied in `:name`, fully URL-encoded using `%2f`\n3. The server resolves `custom_hooks/../../...` without validation\n4. Arbitrary file contents are displayed and existing files can be overwritten\n\n---\n\n## Potential Impact\n\n* **Sensitive information disclosure:** `app.ini`, databases, logs, environment variables, etc.\n* **Configuration or data tampering:** Overwriting existing files\n* **Secondary impact:** Extraction of `SECRET_KEY` and database credentials may allow token forging or further compromise","format":"markdown","source":"ghsa"},{"lang":"en","text":"Gogs has arbitrary file read/write via Path Traversal in Git hook editing 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 autoalojado de código abierto. En la versión 0.13.3 y anteriores, existe una lectura/escritura de archivo arbitraria mediante salto de ruta en la edición de hooks de Git. Este problema ha sido parcheado en las versiones 0.13.4 y 0.14.0+dev.","source":"nvd"}],"published":"2026-02-06T17:46:59.683Z","modified":"2026-06-17T10:21:52.310Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N","score":6.5,"rating":"MEDIUM"}],"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-mrph-w4hh-gx3g","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-23633","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/gogs/gogs/commit/4894629903f9508fe85567c44f68804f008f1655","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/gogs/gogs","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/gogs/gogs/releases/tag/v0.13.4","tags":["web"],"sources":["ghsa","go"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-02-06T18:53:18.442Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-23633","url":"https://www.cve.org/CVERecord?id=CVE-2026-23633","licence":"CVE Terms of Use","modified":"2026-02-06T18:53:26.328Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mrph-w4hh-gx3g","url":"https://github.com/advisories/GHSA-mrph-w4hh-gx3g","licence":"CC-BY-4.0","modified":"2026-02-19T20:41:23.828Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4453","url":"https://pkg.go.dev/vuln/GO-2026-4453","licence":"CC-BY-4.0","modified":"2026-02-19T20:41:23.828Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-23633","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-23633","licence":"Public domain","modified":"2026-06-17T10:21:52.310Z"}],"updatedAt":"2026-11-25T22:59:13.559Z","epss":{"score":0.00506,"percentile":0.44763,"date":"2026-12-01T12:00:22.000Z"}}