CVE-2022-30580: Empty Cmd.Path can trigger unintended binary in os/exec on Windows
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.
Other sources
Empty Cmd.Path can trigger unintended binary in os/exec on Windows
— Microsoft
Golang Go could allow a local attacker to execute arbitrary code on the system, caused by a flaw when Cmd.Run, cmd.Start, cmd.Output, or cmd.CombinedOutput are executed when Cmd.Path is unset. By sending a specially-crafted request, an attacker could exploit this vulnerability to execute arbitrary code on the system.
— IBM
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the vulnerability ID of this code injection vulnerability?
The vulnerability ID is CVE-2022-30580.
What is the severity of CVE-2022-30580?
The severity of CVE-2022-30580 is high with a CVSS score of 7.8.
Which software versions are affected by CVE-2022-30580?
Versions of Go before 1.17.11 and versions between 1.18.0 and 1.18.3 are affected by CVE-2022-30580.
How can an attacker exploit this vulnerability?
An attacker can exploit this vulnerability by calling Cmd.Run, Cmd.Start, Cmd.Output, or Cmd.CombinedOutput when Cmd.Path is unset, allowing execution of any binaries in the working directory named "..com" or "..exe".
Are there any fix or workaround available for CVE-2022-30580?
Yes, upgrading to Go 1.17.11 or Go 1.18.3 or later versions is recommended to fix CVE-2022-30580.