CVE-2024-56731
criticalpriority · track · 39EPSS 0.011 · 67 %ileDEEUUSEPSS · scored 2026-10-23
Gogs 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.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (5)
Products and version ranges known to be affected.
advisories (3)
Vendor and ecosystem advisories describing this.
- WID-SEC-W-2025-1383Gogs: Mehrere SchwachstellenDeutsch2025-06-24csaf · cert_bundDE
Ein Angreifer kann mehrere Schwachstellen in Gogs ausnutzen, um beliebigen Programmcode auszuführen, und um einen Cross-Site Scripting Angriff durchzuführen.
- GHSA-wj44-9vcg-wjq7Gogs allows deletion of internal files which leads to remote command execution2025-06-24ghsa · osvUS
### Summary Due to the insufficient patch for the CVE-2024-39931, it's still possible to delete files under the `.git` directory and achieve remote command execution. ### Details In the patch for CVE-2024-39931, the following check is added: https://github.com/gogs/gogs/commit/77a4a945ae9a87f77e392e9066b560edb71b5de9 ```diff + // 🚨 SECURITY: Prevent uploading files into the ".git" directory + if isRepositoryGitPath(opts.TreePath) { + return errors.Errorf("bad tree path %q", opts.TreePath) + } ``` While the above code snippet checks if the specified path is a `.git` directory, there are no checks for symbolic links in the later steps. So, by creating a symbolic link that points to the `.git` directory, an attacker can still delete arbitrary files in the `.git` directory and achieve remote command execution. ### Impact Unprivileged user accounts can execute arbitrary commands on the Gogs instance with the privileges of the account specified by `RUN_USER` in the configuration. It allows attackers to access and alter any users' code hosted on the same instance.
- GO-2025-3776Gogs allows deletion of internal files which leads to remote command execution in gogs.io/gogs2025-07-28vendor · osvUS
Gogs allows deletion of internal files which leads to remote command execution in gogs.io/gogs
also known as (5)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (12)
External citations — patches, advisories, analysis.
- https://access.redhat.com/security/cve/cve-2024-56731cnnvd
- https://github.com/gogs/gogs/commit/77a4a945ae9a87f77e392e9066b560edb71b5de9cnnvd
- https://github.com/gogs/gogs/releasesPatchcnnvd
- https://github.com/gogs/gogs/releases/tag/v0.13.3cnnvd
- https://github.com/gogs/gogs/security/advisories/GHSA-wj44-9vcg-wjq7cnnvd
- https://nvd.nist.gov/vuln/detail/CVE-2024-56731cnnvd
- https://github.com/gogs/gogs/commit/77a4a945ae9a87f77e392e9066b560edb71b5de9enisa_euvd
- https://github.com/gogs/gogs/releases/tag/v0.13.3enisa_euvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan