CVE-2024-39930 Duplicate Advisory: github.com/gogs/gogs affected by CVE-2024-39930

Critical 9.9 Published Updated

Authenticated attackers can achieve remote code execution via argument injection in the built-in SSH server if enabled.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-39930?

CVE-2024-39930 is a critical command injection vulnerability in n/a, published on 4 Jul 2024. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

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.

Weakness: CWE-88

Which versions are affected by CVE-2024-39930?

5 open source packages ship an affected version, including github.com/gogs/gogs and gogs.io/gogs. It affects 1 product.

PackageAffectedFixed in
github.com/gogs/gogs GoAll versionsNone
github.com/gogs/gogs GoAll versions to 0.13.0None
github.com/gogs/gogs GoAll versions to 0.13.0None
gogs.io/gogs GoAll versions0.13.1
gogs.io/gogs GoAll versions0.13.1

Products include Gogs Gogs.

How do I fix CVE-2024-39930?

Upgrade to a fixed version.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2024-39930 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-39930 exists.

Public exploit code: 1 Exploit-DB entry and 3 proofs of concept on GitHub.

Sources

Also known as GHSA-p69r-v3h4-rj4f, GHSA-vm62-9jw3-c8w3, GO-2024-2969.

Is CVE-2024-39930 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free