Skip to content
Threat Brief

← All advisories

CVE-2026-97042

High 8.8No known exploitationFix available

Linker flag injection via cgo_import_dynamic and PE DLL names in cmd/cgo, cmd/compile, and cmd/link

Record last updated

CVSS score

8.8

High on a 0 to 10 scale

EPSS, chance of exploitation in 30 days

0.5%

Higher than 40% of scored CVEs. A prediction, not evidence.

CISA remediation deadline

None

Not in the KEV catalog

Description

Building a malicious package that uses "//go:cgo_import_dynamic" or links against a crafted PE object on Windows could pass unsafe library arguments to the external linker. The compiler only checked the first character of the library name in "//go:cgo_import_dynamic" directives and skipped validation in cgo-generated files. In addition, on Windows, "cmd/cgo" and "cmd/link" did not validate imported DLL names extracted from PE object files before emitting "-l<name>" flags for the external linker, allowing a crafted DLL name containing ".." path traversal or special characters to reference arbitrary files on disk. The compiler now validates every character of the library name in "//go:cgo_import_dynamic" directives (including in cgo-generated files on Windows) and rejects ".." path traversal, and "cmd/cgo" and "cmd/link" reject PE imported DLL names containing path separators, "..", ":", or leading "-" or "@".

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

VendorProductAffected versionsFixed inPer
Microsoftazl3 golang 1.26.10-1 on Azure Linux 3.0Not documentedNot documentedMicrosoft MSRC
Microsoftazl3 golang 1.27.3-1 on Azure Linux 3.0Not documentedNot documentedMicrosoft MSRC

Timeline

  1. Advisory

    Microsoft advisory published

    Source: Microsoft MSRC (opens in a new tab)

  2. Advisory change

    Microsoft advisory revised (2.0): Information published.

    Source: Microsoft MSRC (opens in a new tab)

  3. Advisory change

    Microsoft advisory revised (3.0): Information published.

    Source: Microsoft MSRC (opens in a new tab)

  4. Advisory change

    Microsoft advisory revised (4.0): Information published.

    Source: Microsoft MSRC (opens in a new tab)

  5. Patch

    Fix documented by Microsoft MSRC

    Source: Microsoft MSRC (opens in a new tab)

Vendor guidance and references