CVE-2026-97035
High 8.8No known exploitationFix availableUnexpected code execution and arbitrary file write via Clang -gen-* and GCC -gnat* flags in cgo in cmd/go
Record last updated
CVSS score
High on a 0 to 10 scale
EPSS, chance of exploitation in 30 days
Higher than 46% of scored CVEs. A prediction, not evidence.
CISA remediation deadline
Not in the KEV catalog
Description
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 <dir>" flag and GCC's two-argument "-gnatO <file>" 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.
Weakness: CWE-88
Patching and mitigation
- Patch status
- Fix available (source: Microsoft MSRC)
- Fix documented (source date)
- Mitigation
- None documented
- Vendor guidance
- msrc.microsoft.com (opens in a new tab)
Affected products
| Vendor | Product | Affected versions | Fixed in | Per |
|---|---|---|---|---|
| Microsoft | azl3 golang 1.26.10-1 on Azure Linux 3.0 | Not documented | Not documented | Microsoft MSRC |
| Microsoft | azl3 golang 1.26.11-1 on Azure Linux 3.0 | Not documented | Not documented | Microsoft MSRC |
| Microsoft | azl3 golang 1.27.3-1 on Azure Linux 3.0 | Not documented | Not documented | Microsoft MSRC |
| Microsoft | azl3 golang 1.27.4-1 on Azure Linux 3.0 | Not documented | Not documented | Microsoft MSRC |
Timeline
Advisory
Microsoft advisory published
Advisory change
Microsoft advisory revised (2.0): Information published.
Advisory change
Microsoft advisory revised (3.0): Information published.
Advisory change
Microsoft advisory revised (4.0): Information published.
Patch
Fix documented by Microsoft MSRC