Arbitrary code execution during build on darwin via "-l to_library" in cgo in cmd/go
Summary
| CVE | CVE-2026-97036 |
|---|---|
| State | PUBLISHED |
| Assigner | Go |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2026-11-11 05:19:57 UTC |
| Updated | 2026-11-17 05:18:38 UTC |
| Description | On Darwin, building a malicious package that uses cgo could cause arbitrary code execution when using the Apple linker due to passing "-l to_library <path>" in a "#cgo LDFLAGS" directive. The Apple linker recombines the separated arguments "-l" and "to_library" into "-lto_library", which loads an arbitrary LTO plugin dynamic library at link time. The go command now disallows "-l" followed by "to_library" in "#cgo LDFLAGS", rejects "-lazy_library", "-lazy_framework", "-load_hidden", "-library", and "-library-path", and checks recombined "-l" arguments against disallowed linker flags and patterns. |
Risk And Classification
Primary CVSS: v3.1 8.8 HIGH from ADP
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS: 0.005410000 probability, percentile 0.460870000 (date 2026-11-17)
Problem Types: CWE-88 | CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') | CWE-88 CWE-88 Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
| Version | Source | Type | Score | Severity | Vector |
|---|---|---|---|---|---|
| 3.1 | ADP | DECLARED | 8.8 | HIGH | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| 3.1 | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | Secondary | 8.8 | HIGH | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
CVSS v3.1 Breakdown
Attack Vector
NetworkAttack Complexity
LowPrivileges Required
NoneUser Interaction
RequiredScope
UnchangedConfidentiality
HighIntegrity
HighAvailability
HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Vendor Declared Affected Products
| Source | Vendor | Product | Version | Platforms |
|---|---|---|---|---|
| CNA | Go Toolchain | Cmd/go | affected 1.26.11 semver | darwin |
| CNA | Go Toolchain | Cmd/go | affected 1.27.0-0 1.27.4 semver | darwin |
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| groups.google.com/g/golang-announce/c/iY8TY0wWgbM | [email protected] | groups.google.com | |
| go.dev/issue/82574 | [email protected] | go.dev | |
| pkg.go.dev/vuln/GO-2026-6855 | [email protected] | pkg.go.dev | |
| go.dev/cl/862149 | [email protected] | go.dev | |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
Vendor Comments And Credit
Discovery Credit
CNA: Ali Sherif (https://www.linkedin.com/in/ali-sherif-13812b276/) (en)
There are currently no legacy QID mappings associated with this CVE.