CVE-2024-39930 — Gogs has an argument Injection in gogs.io/gogs
Gogs has an argument Injection in the built-in SSH server
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (7.81%). 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-39930 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.
Summary
Impact
When the built-in SSH server is enabled ([server] START_SSH_SERVER = 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 RUN_USER 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
Disable the use of built-in SSH server on operating systems other than Windows.
References
Advisory Timeline
- First published December 23, 2024 (703 days ago).
- Last revised December 23, 2024 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
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).
| Package | Fixed In |
|---|---|
| gogs.io/gogs Go · Affected: All versions | 0.13.1 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-88
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 9.9 score means for each attack dimension.
CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N
References
- https://github.com/gogs/gogs/security/advisories/GHSA-vm62-9jw3-c8w3WEB
- https://github.com/gogs/gogsPACKAGE
- https://www.sonarsource.com/blog/securing-developer-tools-unpatched-code-vulnerabilities-in-gogs-1WEB
- https://www.vicarius.io/vsociety/posts/argument-injection-in-gogs-ssh-server-cve-2024-39930WEB
Frequently Asked Questions
- What is CVE-2024-39930?
- Gogs has an argument Injection in the built-in SSH server. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.9/10).
- How do I check if my project is affected by CVE-2024-39930?
- CVE-2024-39930 affects gogs.io/gogs. It has a 7.8% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2024-39930 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
This places it in the top 5% of EPSS-scored vulnerabilities — 95.4% of tracked vulnerabilities score at or below it, so it is far more likely to be exploited than nearly all other tracked vulnerabilities.
Also Known As
Related CVEs
- CVE-2026-52806CRITICAL
Gogs vulnerable to RCE via git rebase --exec argument injection in pull request merge
- CVE-2024-56731CRITICAL
Gogs allows deletion of internal files which leads to remote command execution
- CVE-2026-52797HIGH
Gogs: Overwriting critical files results in a denial of service
- CVE-2026-52800HIGH
Gogs Vulnerable to CSRF Leading to Organization Owner Takeover
- CVE-2024-55947HIGH
Path Traversal in file update API in gogs
- CVE-2024-54148HIGH
Remote Command Execution in file editing in gogs
- CVE-2026-26022HIGH
Gogs: Stored XSS via data URI in issue comments
- CVE-2026-52816MEDIUM
Gogs's Unauthenticated Jupyter Notebook (ipynb) Sanitizer allows arbitrary data: URIs leading to XSS