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

Description

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

Basic information

Type
reviewed
Severity
critical
Advisory on GitHub
Open advisory ↗
Repository advisory
Open repository advisory ↗
Source code
Browse source ↗
Published (advisory)
2024-12-23 20:38:34 UTC
Updated
2024-12-23 20:38:35 UTC
GitHub reviewed
2024-12-23 20:38:34 UTC

EPSS Score

Score Percentile
11.88% 93.50%

CVSS Scores

Base score Version Severity Vector
10.0 3.1
CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N Click to expand
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
Scope (S:C)
Breaking this can reach past the original component and bite other resources—bigger blast radius.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.

Identifiers

CWEs

CWE id Name
CWE-88 Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')

Credits

  • swapgs (reporter)

Affected packages (1)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
go gogs.io/gogs <= 0.13.0 0.13.1

References

cvelogic Threat Intelligence