Security Digest · Vulnerability record

CVE-2024-56731: Gogs allows deletion of internal files which leads to remote command execution

Gogs is an open source self-hosted Git service.

CVSS 10.0 Critical EPSS 1.1% · p67

Should you act?

Critical and remotely reachable

No known exploitation yet, but it is network-reachable without credentials. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.

  • No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
  • EPSS 1.1%, percentile 67: FIRST’s model estimates a 1.1% chance of exploitation activity in the next 30 days, higher than 67% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
  • Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
  • Only applies if your dependency tree includes gogs.io/gogs (Go) <= 0.13.2, fixed in 0.13.3. Check your lockfile, including transitive dependencies.

What it is

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 RUNUSER 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.

From the GitHub advisory

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

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 RUNUSER in the configuration. It allows attackers to access and alter any users' code hosted on the same instance.

Weakness type: CWE-552.

Product: gogs.io/gogs (Go) · Assigned by: GitHub_M · Published: 2025-06-24

Affected and fixed versions

EcosystemPackageVulnerableFirst fixed
Gogogs.io/gogs<= 0.13.20.13.3
VendorProductAffected versions (per CVE record)
gogsgogs< 0.13.3

Severity scores

Scored byCVSSScoreVector
GitHub_M3.110 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
GitHub3.110.0 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
  • Attack vector: network (remotely reachable)
  • Attack complexity: low
  • Privileges required: none (no login)
  • User interaction: none
  • Scope: changed (can affect other components)

CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.

Exploitation and urgency

  • CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
  • CISA SSVC assessment: exploitation none, automatable yes, technical impact total.
  • FIRST EPSS (model of 2026-10-21): 1.15% probability of exploitation activity in the next 30 days; percentile 67.

Timeline

  • — CVE record published by GitHub_M
  • — GitHub-reviewed advisory GHSA-wj44-9vcg-wjq7 published (critical)
  • — CVE record last updated

Sources and references

Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.

Vulnerability records

  1. GitHub Advisory GHSA-wj44-9vcg-wjq7 github.com
  2. CVE.org record CVE-2024-56731 cve.org
  3. NVD entry CVE-2024-56731 nvd.nist.gov

Other references from the CVE record and advisory

  1. github.com github.com
  2. github.com github.com
  3. github.com github.com
  4. github.com github.com

Critical Go advisories · Today’s Security Digest