CVE-2026-23633: Gogs has arbitrary file read/write via Path Traversal in Git hook editing
Vulnerability Description In the endpoint: the :name parameter: Is URL-decoded by macaron routing, allowing decoded slashes (/) Is then passed directly to: which internally resolves the path as: Because no path sanitization is applied, supplying ../ sequences allows access to arbitrary paths outside the repository.
Published Feb 6, 2026
Affected packages
gogs.io/gogs
- Ecosystem
- Go
- Affected
- <= 0.13.3
- Fixed in
- 0.13.4
- Check
go list -m gogs.io/gogs
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Vulnerability Description
In the endpoint:
/username/reponame/settings/hooks/git/:namethe :name parameter:
- Is URL-decoded by macaron routing, allowing decoded slashes (
/) - Is then passed directly to:
git.Repository.Hook("custom_hooks", name)which internally resolves the path as:
filepath.Join(repoPath, "custom_hooks", name)Because no path sanitization is applied, supplying ../ sequences allows access to arbitrary paths outside the repository.
As a Result:
- GET: Arbitrary file contents are displayed in the hook edit page textarea (Local File Inclusion).
- POST: Existing files can be overwritten with attacker-controlled content (Arbitrary File Write).
---
Attack Prerequisites
- The attacker is an authenticated user
- The attacker has Admin or higher privileges on the target repository
- The attacker has the AllowGitHook permission (or is a site administrator)
- The target file is readable/writable by the Gogs process OS permissions
---
Attack Scenario
- An attacker (with AllowGitHook + repository Admin privileges) accesses the Git hook edit URL
- A path containing
../is supplied in:name, fully URL-encoded using%2f - The server resolves
custom_hooks/../../...without validation - Arbitrary file contents are displayed and existing files can be overwritten
---
Potential Impact
- Sensitive information disclosure:
app.ini, databases, logs, environment variables, etc. - Configuration or data tampering: Overwriting existing files
- Secondary impact: Extraction of
SECRET_KEYand database credentials may allow token forging or further compromise
Credited to odgrso.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-52800
Gogs Vulnerable to CSRF Leading to Organization Owner Takeover
high8.8Jun 23, 2026CVE-2026-52801
Gogs has the ability to import local repositories via Mirror Settings
high8.1Jun 23, 2026CVE-2026-52802
Gogs has an Open Redirect via redirect_to
medium5.4Jun 23, 2026CVE-2026-52804
Gogs Vulnerable to Privilege Escalation via Collaboration Access Mode Validation
medium5.5Jun 23, 2026CVE-2026-52805
Gogs has a Migration Redirect Bypass that Leads to Internal Repository Theft
high8.7Jun 23, 2026CVE-2026-52806
Gogs vulnerable to RCE via git rebase --exec argument injection in pull request merge
critical9.9Jun 23, 2026
