Security Digest · Vulnerability record
CVE-2024-39930: Gogs has an argument Injection in the built-in SSH server
The built-in SSH server of Gogs through 0.13.0 allows argument injection in internal/ssh/ssh.go, leading to remote code execution.
CVSS 9.9 Critical EPSS 7.7% · p95
Should you act?
Critical, preconditions apply
Severe if exploited, but exploitation needs conditions that may not apply to you. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.
- Not in CISA KEV, but CISA’s SSVC assessment records a public proof-of-concept, so attack code exists.
- EPSS 7.7%, percentile 95: FIRST’s model estimates a 7.7% chance of exploitation activity in the next 30 days, higher than 95% of all scored CVEs (elevated). EPSS is a probability, not a verdict.
- Needs an account (low (any account)). Exposure depends on who can log in.
- Only applies if your dependency tree includes
gogs.io/gogs(Go) <= 0.13.0, fixed in 0.13.1. Check your lockfile, including transitive dependencies.
What it is
The built-in SSH server of Gogs through 0.13.0 allows argument injection in internal/ssh/ssh.go, leading to remote code execution. Authenticated attackers can exploit this by opening an SSH connection and sending a malicious --split-string env request if the built-in SSH server is activated. Windows installations are unaffected.
From the GitHub advisory
Impact
When the built-in SSH server is enabled ([server] STARTSSHSERVER = true), unprivileged user accounts with at least one SSH key can execute arbitrary commands on the Gogs instance with the privileges of the user specified by RUNUSER in the configuration. It allows attackers to access and alter any users' code hosted on the same instance.
Patches
The env command sent to the internal SSH server has been changed to be a passthrough (https://github.com/gogs/gogs/pull/7868), i.e. the feature is effectively removed. Users should upgrade to 0.13.1 or the latest 0.14.0+dev.
Workarounds
Weakness type: CWE-88.
Product: gogs.io/gogs (Go) · Assigned by: mitre · Published: 2024-07-04
Affected and fixed versions
| Ecosystem | Package | Vulnerable | First fixed |
|---|---|---|---|
| Go | gogs.io/gogs | <= 0.13.0 | 0.13.1 |
| Vendor | Product | Affected versions (per CVE record) |
|---|---|---|
| n/a | n/a | see vendor advisory |
Severity scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| mitre | 3.1 | 9.9 Critical | CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N |
| GitHub | 3.1 | 9.9 | CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N |
- Attack complexity: low
- Attack vector: network (remotely reachable)
- Privileges required: low (any account)
- Scope: changed (can affect other components)
- User interaction: none
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 poc, automatable no, technical impact total.
- FIRST EPSS (model of 2026-10-21): 7.74% probability of exploitation activity in the next 30 days; percentile 95.
Timeline
- — CVE record published by mitre
- — CVE record last updated
- — GitHub-reviewed advisory GHSA-vm62-9jw3-c8w3 published (critical)
Sources and references
Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.
Vulnerability records
- GitHub Advisory GHSA-vm62-9jw3-c8w3 github.com
- CVE.org record CVE-2024-39930 cve.org
- NVD entry CVE-2024-39930 nvd.nist.gov
Other references from the CVE record and advisory
- github.com github.com
- sonarsource.com sonarsource.com
- vicarius.io vicarius.io
- github.com github.com