CVE-2026-23633
Path Traversal in Gogs Git Hook Editing Allows Arbitrary File Access
Publication date: 2026-02-06
Last updated on: 2026-02-17
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| gogs | gogs | to 0.13.4 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-22 | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
CVE-2026-23633 is a moderate severity vulnerability in the Gogs Git service, affecting versions up to 0.13.3. It arises from improper handling of the Git hook editing endpoint, where the parameter used to specify the hook name is URL-decoded without sanitization, allowing path traversal sequences to escape the intended directory.
This lack of path sanitization allows an authenticated attacker with admin or higher privileges and specific permissions to read or overwrite arbitrary files on the server by manipulating the file path.
Specifically, an attacker can perform arbitrary file read (local file inclusion) via GET requests to view contents of files accessible by the Gogs process, and arbitrary file write via POST requests to overwrite existing files with attacker-controlled content.
How can this vulnerability impact me? :
This vulnerability can lead to serious impacts including disclosure of sensitive information and unauthorized modification of files.
- Disclosure of sensitive files such as configuration files (e.g., app.ini), databases, logs, and environment variables.
- Tampering with configuration or data by overwriting files, potentially disrupting service or altering behavior.
- Secondary impacts such as extraction of secret keys and database credentials, which could enable token forging or further system compromise.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
I don't know
How can this vulnerability be detected on my network or system? Can you suggest some commands?
[{'type': 'paragraph', 'content': 'This vulnerability can be detected by checking if your Gogs instance is running a vulnerable version (0.13.3 or earlier) and by testing the specific Git hook editing endpoint for path traversal.'}, {'type': 'paragraph', 'content': 'You can attempt to detect exploitation attempts by monitoring HTTP requests to the endpoint pattern: /username/reponame/settings/hooks/git/:name where :name contains encoded path traversal sequences such as %2f or ../.'}, {'type': 'paragraph', 'content': 'Example commands to detect potential exploitation attempts or test the vulnerability include:'}, {'type': 'list_item', 'content': 'Using curl to attempt a GET request with path traversal sequences to read arbitrary files (replace USERNAME and REPONAME accordingly):'}, {'type': 'list_item', 'content': 'curl -i -H "Cookie: user_session=YOUR_AUTH_COOKIE" "http://your-gogs-server/USERNAME/REPONAME/settings/hooks/git/%2e%2e%2f%2e%2e%2fapp.ini"'}, {'type': 'list_item', 'content': 'Using curl to attempt a POST request to overwrite a file (requires admin privileges and appropriate permissions):'}, {'type': 'list_item', 'content': 'curl -X POST -H "Cookie: user_session=YOUR_AUTH_COOKIE" -d "content=malicious_content" "http://your-gogs-server/USERNAME/REPONAME/settings/hooks/git/%2e%2e%2f%2e%2e%2fpath/to/target/file"'}, {'type': 'paragraph', 'content': 'Additionally, reviewing server logs for suspicious requests containing encoded path traversal sequences in the hook editing endpoint can help detect attempts.'}] [1]
What immediate steps should I take to mitigate this vulnerability?
The immediate and most effective mitigation is to upgrade your Gogs installation to version 0.13.4 or later, where this vulnerability has been patched.
If upgrading is not immediately possible, restrict access to the Git hook editing functionality to trusted administrators only, ensuring that only users with necessary permissions can access it.
Monitor and audit repository admin activities and server logs for suspicious access patterns involving the hook editing endpoint.
Consider applying network-level controls such as firewall rules or web application firewall (WAF) rules to block requests containing encoded path traversal sequences (%2f, ../) targeting the vulnerable endpoint.