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.

Project Subscriptions

No data.

Advisories

No advisories yet.

Fixes

Solution

No solution given by the vendor.


Workaround

No workaround given by the vendor.

History

Mon, 16 Nov 2026 18:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-78

Mon, 16 Nov 2026 16:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-77
Metrics cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Sun, 15 Nov 2026 00:45:00 +0000

Type Values Removed Values Added
Weaknesses CWE-78

Sat, 14 Nov 2026 23:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-94

Sat, 14 Nov 2026 03:45:00 +0000

Type Values Removed Values Added
Weaknesses CWE-94

Fri, 13 Nov 2026 00:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-78

Thu, 12 Nov 2026 06:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-78

Wed, 11 Nov 2026 03:30:00 +0000

Type Values Removed Values Added
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.
Title Arbitrary command execution via GCC spec files in cgo linker search directories in cmd/go
References

Projects

Sign in to view the affected projects.

cve-icon MITRE

Status: PUBLISHED

Assigner: Go

Published:

Updated: 2026-11-17T04:55:30.177Z

Reserved: 2026-09-23T23:04:46.550Z

Link: CVE-2026-97034

cve-icon Vulnrichment

Updated: 2026-11-16T15:37:02.864Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-11-11T05:19:57.397

Modified: 2026-11-17T05:18:38.390

Link: CVE-2026-97034

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-11-16T19:45:09Z

Weaknesses