CWE
94 20
Advisory Published
CVE Published
Updated

CVE-2020-28366: Arbitrary code execution in go command with cgo in cmd/go and cmd/cgo

First published: Thu Nov 12 2020(Updated: )

An input validation vulnerability was found in Go. From a generated go file (from the cgo tool), it is possible to modify symbols within that object file and specify code. This flaw allows an attacker to create a repository that includes malicious pre-built object files that could execute arbitrary code when downloaded and run via `go get` or `go build` while building a Go project. The highest threat from this vulnerability is to confidentiality, integrity, as well as system availability.

Credit: cve@mitre.org

Affected SoftwareAffected VersionHow to fix
redhat/go<1.15.5
1.15.5
redhat/go<1.14.12
1.14.12
redhat/openshift-serverless-clients<0:0.18.4-2.el8
0:0.18.4-2.el8
redhat/go-toolset<1.14-0:1.14.12-1.el7_9
1.14-0:1.14.12-1.el7_9
redhat/go-toolset<1.14-golang-0:1.14.12-1.el7_9
1.14-golang-0:1.14.12-1.el7_9
Golang Go<1.14.12
Golang Go>=1.15<1.15.5
Fedoraproject Fedora=32
Fedoraproject Fedora=33
Netapp Cloud Insights Telegraf Agent
Netapp Trident
IBM Cloud Pak for Security<=1.10.0.0 - 1.10.11.0
IBM QRadar Suite Software<=1.10.12.0 - 1.10.16.0

Remedy

If it's possible to confirm that the Go project being built does not rely on any cgo code in the included dependencies, the env variable CGO_ENABLED=0 can be specified when using either `go get` or `go build`. For example: CGO_ENABLED=0 go get github.com/someproject This will not stop the files being downloaded but will stop any automatic complication of the cgo code, including inlined in the go file and separate .c files. Of course, this will only be effective if cgo is not relied upon in a given dependency and may not be appropriate in all scenarios.

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Parent vulnerabilities

(Appears in the following advisories)

Frequently Asked Questions

  • What is the vulnerability ID for this Go code injection vulnerability?

    The vulnerability ID for this Go code injection vulnerability is CVE-2020-28366.

  • What is the severity of CVE-2020-28366?

    The severity of CVE-2020-28366 is high with a CVSS score of 7.5.

  • Which versions of Go are affected by this vulnerability?

    Versions before Go 1.14.12 and Go 1.15.5 are affected by this vulnerability.

  • How can an attacker exploit this vulnerability?

    An attacker can exploit this vulnerability by modifying symbols within a generated go file and specifying malicious code.

  • What is the remedy for this vulnerability?

    The remedy for this vulnerability is to update to Go 1.14.12 or Go 1.15.5.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2024 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203