CVE-2022-30580

Empty Cmd.Path can trigger unintended binary in os/exec on Windows

State
Published
Severity
7.8 High
Published
Aug 9, 2022
Updated
Mar 6, 2026
Reserved
May 11, 2022

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
3.17.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HCISA-ADP

Weaknesses

  • CWE-94 Improper Control of Generation of Code ('Code Injection')

Affected Products

ProductVersions
os/execGo standard library
  • before 1.17.11Affected
  • 1.18.0-0 to before 1.18.3Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.