Building a malicious package that uses cgo could cause arbitrary code execution at link time by passing linker script files to the host linker via "#cgo LDFLAGS". Split "-Wl," flags that consume a following argument (such as "-Wl,-rpath", "-Wl,--just-symbols", and "-Wl,-undefined") previously accepted a bare second argument without a "-Wl," prefix, which the compiler driver passes directly to the linker as a positional input file. Additionally, when using GNU ld.bfd, flags such as "-framework", "-Wl,-framework", "-Wl,-undefined", "-Wl,--just-symbols", "-Wl,-R", "-Wl,-subsystem", and (on non-Darwin platforms) "-Wl,-sectcreate" could cause ld.bfd to interpret their arguments as linker scripts if they named a regular file on disk. The go command now requires a "-Wl," prefix on the second token of split "-Wl," flags (except "-Wl,-R"), verifies that these flags do not reference linker script files, and disallows bare "-Wl,--warn-backrefs-exclude".

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:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-20
CWE-78

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

Type Values Removed Values Added
Metrics ssvc

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


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

Type Values Removed Values Added
Weaknesses CWE-94
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'}


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

Type Values Removed Values Added
Weaknesses CWE-20
CWE-78

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

Type Values Removed Values Added
Weaknesses CWE-20
CWE-78

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

Type Values Removed Values Added
Weaknesses CWE-20
CWE-78

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

Type Values Removed Values Added
Weaknesses CWE-78
CWE-94

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

Type Values Removed Values Added
Weaknesses CWE-78
CWE-94

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

Type Values Removed Values Added
Description Building a malicious package that uses cgo could cause arbitrary code execution at link time by passing linker script files to the host linker via "#cgo LDFLAGS". Split "-Wl," flags that consume a following argument (such as "-Wl,-rpath", "-Wl,--just-symbols", and "-Wl,-undefined") previously accepted a bare second argument without a "-Wl," prefix, which the compiler driver passes directly to the linker as a positional input file. Additionally, when using GNU ld.bfd, flags such as "-framework", "-Wl,-framework", "-Wl,-undefined", "-Wl,--just-symbols", "-Wl,-R", "-Wl,-subsystem", and (on non-Darwin platforms) "-Wl,-sectcreate" could cause ld.bfd to interpret their arguments as linker scripts if they named a regular file on disk. The go command now requires a "-Wl," prefix on the second token of split "-Wl," flags (except "-Wl,-R"), verifies that these flags do not reference linker script files, and disallows bare "-Wl,--warn-backrefs-exclude".
Title Linker script injection via split -Wl, flags and Darwin or symbol linker flags in cgo 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:25.636Z

Reserved: 2026-09-23T23:05:04.987Z

Link: CVE-2026-97037

cve-icon Vulnrichment

Updated: 2026-11-16T15:02:33.119Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-11-11T05:19:57.860

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

Link: CVE-2026-97037

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

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

Weaknesses