CVE-2026-97037

Description

A flaw was found in cmd/go. An attacker can achieve arbitrary code execution on a system that compiles a malicious package utilizing cgo (Go's C programming language integration feature). When building the untrusted package, improperly validated linker flags allow malicious linker script files to be forwarded to the host linker, enabling untrusted command execution during the build process.

Statement

This vulnerability is rated as Moderate impact for Red Hat products because exploitation requires explicit user interaction to fetch and compile untrusted source code. The issue resides within the Go build toolchain and is only triggered during the link phase of compilation when processing packages with C language bindings. Deployed binaries and runtime environments running pre-compiled Go software are unaffected. In typical deployments, risk is confined to development workstations and continuous integration pipelines handling untrusted third-party repositories.

Mitigation

Disable cgo support by setting the environment variable `CGO_ENABLED=0` before compiling Go code, or isolate build environments processing untrusted dependencies within a sandboxed container.

To disable cgo in the environment:

export CGO_ENABLED=0

Caveats: Setting `CGO_ENABLED=0` will cause build failures for any Go applications or modules that strictly depend on C language bindings or native C libraries. In environments where cgo is strictly required, avoid compiling untrusted Go source packages or isolate the build process inside a restricted, unprivileged container with no access to sensitive host directories or network resources.

Common Vulnerability Scoring System (CVSS) Score Details

Info alert:Important note

CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score7.8N/A8.8
Attack VectorLocalN/ANetwork
Attack ComplexityLowN/ALow
Privileges RequiredNoneN/ANone
User InteractionRequiredN/ARequired
ScopeUnchangedN/AUnchanged
ConfidentialityHighN/AHigh
Integrity ImpactHighN/AHigh
Availability ImpactHighN/AHigh

Vector

Red Hat: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

cve.org: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Understanding the Weakness (CWE)

Confidentiality,Integrity,Availability,Other

Technical Impact: Execute Unauthorized Code or Commands; Alter Execution Logic; Read Application Data; Modify Application Data

If an attacker can provide an untrusted input that contains argument-separating delimiters, then the resulting command will have more arguments than intended by the developer, potentially changing the expected behavior of the command. Depending on the functionality supported by the extraneous arguments, this may have security-relevant consequences. The attacker could include arguments that allow unintended commands or code to be executed, allow sensitive data to be read or modified, or cause other unintended behavior.

Frequently Asked Questions

Want to get errata notifications? Sign up here.