Skip to main content

CVE-2024-39930 — Gogs has an argument Injection in gogs.io/gogs

CRITICAL

Gogs has an argument Injection in the built-in SSH server

Published December 23, 2024Updated December 23, 2024Source: OSV

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.

Check my go.sum

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

https://www.cve.org/CVERecord?id=CVE-2024-39930

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
Update gogs.io/gogs to 0.13.1 or later
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).

PackageFixed In
gogs.io/gogs Go · Affected: All versions0.13.1

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.9 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N

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

CVSS Score
9.9

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
7.81%
EPSS percentile: 95.4

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

GHSA-vm62-9jw3-c8w3
GHSA-p69r-v3h4-rj4f
GO-2024-2969

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my go.sum