GO-2026-6856

Source
https://pkg.go.dev/vuln/GO-2026-6856
Import Source
https://vuln.go.dev/ID/GO-2026-6856.json
JSON Data
https://api.osv.dev/v1/vulns/GO-2026-6856
Aliases
  • CVE-2026-97035
Published
2026-11-11T02:51:11Z
Modified
2026-11-11T03:15:15Z
Summary
Unexpected code execution and arbitrary file write via Clang -gen-* and GCC -gnat* flags in cgo in cmd/go
Details

When using Clang or GCC, building a malicious package that uses cgo could cause unexpected code execution at build time or write files to arbitrary directories via "-gen-" or "-gnat" flags in "#cgo" directives.

The "-g*" wildcard in the compiler and linker flag allowlists previously matched Clang's two-argument "-gen-cdb-fragment-path " flag and GCC's two-argument "-gnatO " flag, permitting compilation database fragments and sidecar output files to be written to arbitrary directories and desynchronizing flag argument parsing between the go command and the compiler driver so that subsequent arguments could be passed as unvalidated positional inputs to the linker.

"-gen-" and "-gnat" flags are now disallowed in "#cgo" compiler and linker flags.

Database specific
{
    "review_status": "REVIEWED",
    "url": "https://pkg.go.dev/vuln/GO-2026-6856"
}
References

Affected packages

Go / toolchain

Package

Name
toolchain
View open source insights on deps.dev
Purl
pkg:golang/toolchain

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.26.11
Introduced
1.27.0-0
Fixed
1.27.4

Ecosystem specific

{
    "imports": [
        {
            "path": "cmd/go"
        }
    ]
}

Database specific

source
"https://vuln.go.dev/ID/GO-2026-6856.json"