CVE-2020-28367 Arbitrary code execution via the go command with cgo in cmd/go

High 7.5 Published Updated

Attackers can execute arbitrary code during build time by injecting malicious gcc flags via cgo directives in Go projects.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2020-28367?

CVE-2020-28367 is a high-severity code injection vulnerability in Golang Go, published on 18 Nov 2020. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

Code injection in the go command with cgo before Go 1.14.12 and Go 1.15.5 allows arbitrary code execution at build time via malicious gcc flags specified via a #cgo directive.

Weakness: CWE-94

Which versions are affected by CVE-2020-28367?

2 open source packages ship an affected version, including golang and toolchain. It affects 1 product.

PackageAffectedFixed in
golang BitnamiAll versions1.14.12, 1.15.5
toolchain GoAll versions1.14.12, 1.15.5

Products include Golang Go.

How do I fix CVE-2020-28367?

Upgrade golang to a fixed version for your release line: 1.14.12 or 1.15.5.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2020-28367 being exploited?

There is no known exploitation of CVE-2020-28367 in the wild and no public exploit code.

All Golang Go vulnerabilities

Sources

Also known as BIT-golang-2020-28367, DEBIAN-CVE-2020-28367, GHSA-827f-m9xx-4cfw, GO-2022-0476, UBUNTU-CVE-2020-28367.

Is CVE-2020-28367 in your software?

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

Check your SBOMs for free