# CVE-2026-97034: Arbitrary command execution via GCC spec files in cgo linker search directories in cmd/go

- Severity: High 8.8 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.83%, higher than 58% of CVEs (2026-12-01)
- Published: 2026-11-11T02:51:11.000Z
- Modified: 2026-11-27T06:56:12.290Z
- Also known as: GO-2026-6857, BIT-GOLANG-2026-97034
- Related: RHSA-2026:101231, RHSA-2026:102586, RHSA-2026:102587, RHSA-2026:102592, RHSA-2026:99003, RHSA-2026:99004
- Weaknesses: CWE-77
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: Go

## Description

When using GCC, building a malicious package that uses cgo could cause arbitrary command execution at link time via untrusted GCC spec files ("specs" or "*.spec"). When linking with "-fopenmp", "-fopenacc", or "-fsanitize=" in "#cgo LDFLAGS", GCC's built-in link spec evaluates "%:include(libgomp.spec)" or "%:include(libsanitizer.spec)" and searches for spec files in "-L" and sysroot directories (including subdirectories and multilib sibling directories such as "../lib64"), as well as the working directory when "-fopenmp" or "-fopenacc" is used or when "-fsanitize=" is combined with "-static" or "-static-lib*". The go command now rejects "-L", "-isysroot", and "-Wl,-syslibroot" directories (and the working and package directories when applicable) that contain GCC spec files, and disallows "@" and "-" prefixes in "-fsanitize=" compiler flag values.

(As written by CVE List.)

## Affected

- cmd/go: before 1.26.11; from 1.27.0-0 before 1.27.4
- toolchain (Go): before 1.26.11; from 1.27.0-0 before 1.27.4

## References

- <https://go.dev/cl/862147> (fix)
- <https://go.dev/issue/82576> (report)
- <https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM> (web)
- <https://pkg.go.dev/vuln/GO-2026-6857>

## Sources

- CVE List: [CVE-2026-97034](https://www.cve.org/CVERecord?id=CVE-2026-97034), CVE Terms of Use, modified 2026-11-17
- Go Vulnerability Database: [GO-2026-6857](https://pkg.go.dev/vuln/GO-2026-6857), CC-BY-4.0, modified 2026-11-27
- NVD: [CVE-2026-97034](https://nvd.nist.gov/vuln/detail/CVE-2026-97034), Public domain, modified 2026-11-17

---

Page: https://cve.day/CVE-2026-97034 · Whole record: https://cve.day/CVE-2026-97034.json · Rebuilt by cve.day 2026-11-27T07:27:26.563Z
