What’s Vulnerable › Vulnerabilities
CVE-2022-30580: Empty Cmd.Path can trigger unintended binary in os/exec on Windows
- Severity: high (CVSS 7.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.6% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2022-08-10 · updated 2026-06-17
- Weakness: CWE-94
Description
Code injection in Cmd.Start in os/exec before Go 1.17.11 and Go 1.18.3 allows execution of any binaries in the working directory named either "..com" or "..exe" by calling Cmd.Run, Cmd.Start, Cmd.Output, or Cmd.CombinedOutput when Cmd.Path is unset.
Affected products
- Go: before 1.17.11; from 1.18.0 before 1.18.3 — fixed in 1.17.11, 1.18.3
How to fix
Upgrade to a fixed version: Go 1.17.11, 1.18.3. Check the vendor advisory for mitigations.
References
- https://go.dev/cl/403759
- https://go.dev/issue/52574
- https://go.googlesource.com/go/+/960ffa98ce73ef2c2060c84c7ac28d37a83f345e
- https://groups.google.com/g/golang-announce/c/TzIC9-t8Ytg/m/IWz5T6x7AAAJ
- https://pkg.go.dev/vuln/GO-2022-0532
- https://go.dev/cl/403759
- https://go.dev/issue/52574
- https://go.googlesource.com/go/+/960ffa98ce73ef2c2060c84c7ac28d37a83f345e
- https://groups.google.com/g/golang-announce/c/TzIC9-t8Ytg/m/IWz5T6x7AAAJ
- https://pkg.go.dev/vuln/GO-2022-0532
Get alerted when CVE-2022-30580 or the next vulnerability affects your stack