CVE-2021-3115: Command Injection

Published Jan 20, 2021
·
Updated

A flaw was found in golang: cmd/go, in which Go can execute arbitrary commands at build time when cgo is in use on Windows OS. On Linux/Unix, only users who have "." listed explicitly in their PATH variable are affected. The highest threat from this vulnerability is to data confidentiality and integrity as well as system availability.

Other sources

Go before 1.14.14 and 1.15.x before 1.15.7 on Windows is vulnerable to Command Injection and remote code execution when using the "go get" command to fetch modules that make use of cgo (for example cgo can execute a gcc program from an untrusted download).

Microsoft

Go before 1.14.14 and 1.15.x before 1.15.7 on Windows is vulnerable to Command Injection and remote code execution when using the "go get" command to fetch modules that make use of cgo (for example, cgo can execute a gcc program from an untrusted download).

The go command may execute arbitrary code at build time when users have “.” listed explicitly in their PATH and are running “go get” or build commands outside of a module or with module mode disabled.

Red Hat

Affected Software

15 affected componentsFixes available
redhat/openshift-serverless-clients<0:0.20.0-6.el8
0:0.20.0-6.el8
redhat/openshift-serverless-clients<0:0.20.0-7.el8
0:0.20.0-7.el8
Golang Go<1.14.14
Golang Go>=1.15<1.15.7
Microsoft Windows
Fedoraproject Fedora=33
NetApp Cloud Insights Telegraf Agent
NetApp Storagegrid
All of the following
Any of the following
Golang Go<1.14.14
Golang Go>=1.15<1.15.7
Microsoft Windows
redhat/go<1.15.7
1.15.7
redhat/go<1.14.14
1.14.14
Microsoft azl3 python-tensorboard 2.11.0-3<2.16.2-1
2.16.2-1
Microsoft azl3 python-tensorboard 2.16.2-1<2.16.2-1
2.16.2-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/openshift-serverless-clients to a version that resolves this vulnerability.

    Fixed in 0:0.20.0-6.el8
  2. Upgrade

    Upgrade redhat/openshift-serverless-clients to a version that resolves this vulnerability.

    Fixed in 0:0.20.0-7.el8
  3. Upgrade

    Upgrade redhat/go to a version that resolves this vulnerability.

    Fixed in 1.15.7
  4. Upgrade

    Upgrade redhat/go to a version that resolves this vulnerability.

    Fixed in 1.14.14
  5. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.16.2-1
  6. Upgrade

    Upgrade golang: cmd/go to a version that resolves this vulnerability.

    Fixed in 1.14.14
  7. Upgrade

    Upgrade golang: cmd/go to a version that resolves this vulnerability.

    Fixed in 1.15.7
  8. Configuration

    Mitigate by ensuring the current user's PATH environment variable does not explicitly list '.' (dot); avoid running go get/build with '.' in PATH outside a module or with module mode disabled.

    Go toolchain (go get / build) on Linux/Unix PATH = Remove '.' entry
  9. Compensating control

    For Linux/Unix environments, ensure PATH does not include '.' so the go command cannot execute arbitrary build-time code from the current directory when running go get/build outside of a module or with module mode disabled.

Event History

Jan 20, 2021
CVE Published
12:00 AM
Jan 21, 2021
Data Sourced
via Red Hat·02:21 PM
DescriptionSeverityAffected Software
Jan 26, 2021
CVE Published
via MITRE·02:14 AM
Data Sourced
via MITRE·02:14 AM
Description
Data Sourced
via NVD·06:16 PM
DescriptionSeverityWeaknessAffected Software
Jun 30, 2024
Data Sourced
via Microsoft·02:00 PM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·02:00 PM
Affected Software
Updated
via Microsoft·02:00 PM
Affected Software
Updated
via Microsoft·02:00 PM
DescriptionSeverity

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2021-3115?

CVE-2021-3115 is a vulnerability in Go programming language on Windows OS that allows for command injection and remote code execution.

2

What is the severity level of CVE-2021-3115?

The severity level of CVE-2021-3115 is high, with a CVSS score of 7.5.

3

Which versions of Go are affected by CVE-2021-3115?

Go versions before 1.14.14 and 1.15.x before 1.15.7 on Windows OS are affected by CVE-2021-3115.

4

How can I fix CVE-2021-3115?

To fix CVE-2021-3115, update your Go installations to version 1.14.14 or 1.15.7.

5

Is Microsoft Windows vulnerable to CVE-2021-3115?

No, Microsoft Windows is not vulnerable to CVE-2021-3115.

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.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203