CVE-2026-97035

Description

A flaw was found in cmd/go. An attacker could achieve arbitrary code execution or write files to arbitrary locations by enticing a developer or automated build system to compile a crafted package. This vulnerability occurs when compiling packages that use cgo (Go's C-language interoperability feature), where overly broad compiler flag allowlists permit unexpected multi-argument options that desynchronize command argument parsing and inject unvalidated linker inputs.

Statement

This vulnerability is rated as Moderate severity because exploitation requires an attacker to entice a developer or automated build pipeline into compiling untrusted source code. Runtime environments executing already built binaries are unaffected, as the risk is isolated strictly to the compilation stage. On typical Red Hat Enterprise Linux systems, the Go toolset is utilized as a developer utility rather than an exposed network daemon, limiting the blast radius to development workstations or continuous integration runners processing external code.

Mitigation

Disable cgo during compilation by setting the `CGO_ENABLED` environment variable:

export CGO_ENABLED=0

Caveats: Go packages and applications that require native C bindings will fail to compile while cgo is disabled. If cgo is strictly required, isolate build workflows within unprivileged, ephemeral containers or sandboxes and avoid compiling unverified third-party code.

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.