CVE-2024-56731
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedGogs is an open source self-hosted Git service. Prior to version 0.13.3, it's still possible to delete files under the .git directory and achieve remote command execution due to an insufficient patch for CVE-2024-39931. Unprivileged user accounts can execute arbitrary commands on the Gogs instance with the privileges of the account specified by RUN_USER in the configuration. Allowing attackers to access and alter any users' code hosted on the same instance. This issue has been patched in version 0.13.3.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceGogs versions before 0.13.3 contain a command injection vulnerability where unprivileged users can delete files under the .git directory, leading to remote command execution with the privileges of the RUN_USER account. This stems from an insufficient patch for CVE-2024-39931, allowing attackers to compromise the entire Gogs instance and access/modify any hosted code.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data< 0.13.3CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify installed Gogs versionRun 'gogs --version' or check the Gogs admin dashboard under 'Site Administration > System Info' to find the exact version numberAffected if The installed version is anything less than 0.13.3 (for example, 0.13.0, 0.13.1, 0.13.2, or any version 0.12.x)
-
Verify Gogs configuration file locationLocate the custom/conf/app.ini configuration file typically found in the Gogs data or installation directoryAffected if The configuration file exists and Gogs is running from this setup
-
Check RUN_USER configuration settingIn the app.ini file, locate the [server] section and find the RUN_USER setting to identify which system user account Gogs operates underAffected if RUN_USER is set to a privileged account (such as root) rather than a dedicated low-privilege service account, increasing the impact of successful exploitation
-
Confirm user registration and repository creation settingsIn app.ini under [service], check if REGISTER_EMAIL_CONFIRM, ENABLE_NOTIFY_MAIL, and ALLOW_EXTERNAL_REGISTRATION are configured, and verify if untrusted users can create repositoriesAffected if User registration is open or untrusted users have the ability to create repositories, allowing them to access the vulnerable functionality
You are affected if Gogs version is below 0.13.3 and your instance permits untrusted or unprivileged users to create accounts or access repositories, as they can exploit the .git directory file deletion to achieve command execution with RUN_USER privileges.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scoped0.13.3
Immediately upgrade Gogs to version 0.13.3 or later to patch this vulnerability. Review the RUN_USER configuration and monitor for any unauthorized access or changes to repositories.
Gogs 0.13.3
- Back up your Gogs data directory (usually /home/gogs/gogs) and database
- Download Gogs version 0.13.3 from the official releases: https://github.com/gogs/gogs/releases/tag/v0.13.3
- Stop the Gogs service
- Replace the existing Gogs binary with the new version 0.13.3 binary
- Ensure file permissions match the RUN_USER configured in your gogs/conf/app.ini
- Start the Gogs service
- Verify the upgrade was successful by checking the Gogs version in the admin panel or via API
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation1.0 h
- Testing2.0 h
- Review / QA1.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $1,696.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2024-56731 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2024-56731 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data