CVE-2026-97042
Last modified
CVE-2026-97042 is a vulnerability of currently unknown severity. 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. EPSS estimates a 0.23% chance of exploitation in the next 30 days.
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 "@".
Metrics
Weakness Enumeration
Affected Software
Source: CNA advisory (CVE.org). NVD analysis pending.
| Vendor | Product | Versions |
|---|---|---|
| Go toolchain | cmd/cgo | < 1.26.11; >= 1.27.0-0, < 1.27.4 |
| Go toolchain | cmd/compile | < 1.26.11; >= 1.27.0-0, < 1.27.4 |
| Go toolchain | cmd/link | < 1.26.11; >= 1.27.0-0, < 1.27.4 |
References
Timeline
- Published
- Last Modified
- Status
- Awaiting Analysis
Frequently Asked Questions
What is CVE-2026-97042?
How severe is CVE-2026-97042?
How do I fix CVE-2026-97042?
How Strix Helps
- How Strix found a critical auth bypass in etcdStrix autonomously discovered a critical authentication bypass in etcd, later designated CVE-2026-33413.
- Autonomous PentestingAI agents that find and validate exploitable vulnerabilities like this one across your applications.
- PR ReviewsPentest every pull request so vulnerable code is caught before it ships to production.
- AI Penetration TestingHow AI-driven penetration testing continuously covers your attack surface.
Related CVEs from 2026
- CVE-2026-97037Building a malicious package that uses cgo could cause arbit…
- CVE-2026-97038Building a malicious package containing ".syso" files or cgo…
- CVE-2026-97039Building a malicious package that uses "#cgo pkg-config:" di…
- CVE-2026-9704A flaw was found in Keycloak. An authenticated user with low…8.8
- CVE-2026-97040Building a package containing a crafted ".syso" file could b…
- CVE-2026-97041Building a malicious package containing "//go:cgo_*" compile…
- CVE-2026-97043Building a malicious package that uses cgo could bypass "#cg…
- CVE-2026-97045In childTextNodesAreLiteral, walking up the tree previously …6.1
- CVE-2026-9705A flaw was found in Keycloak's client registration service. …6.5
- CVE-2026-97054For HTTP/1 servers, when MaxBytesReader's limit is exceeded,…
- CVE-2026-97055SigNoz from v0.8.0 before v0.143.0 defaults the JWT tokenize…8.1
- CVE-2026-97056SigNoz versions from v0.98.0 up to (but not including) v0.14…6.8
Are you affected by CVE-2026-97042?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
