# CVE-2026-97042: Linker flag injection via cgo\_import\_dynamic and PE DLL names in cmd/cgo, cmd/compile, and cmd/link

- Priority: **Routine**
- Reason: Not severe (CVSS 8.8, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-11-11 · Modified: 2026-11-16
- Aliases: DEBIAN-CVE-2026-97042, GO-2026-6849, UBUNTU-CVE-2026-97042, ALPINE-CVE-2026-97042
- Record: https://cvemate.com/vulnerability/CVE-2026-97042 · JSON: https://cvemate.com/vulnerability/CVE-2026-97042/json

## Description

```text
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 "@".
```

## Signals

- CVSS: 8.8 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- EPSS: 0.575%, percentile 48.898%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 26)

- alpine go (Alpine Linux): \< 1.26.11-r0 \| \< 1.27.4-r0
- debian golang-1.19 (Debian): All versions (No fix recorded)
- debian golang-1.24 (Debian): All versions (No fix recorded)
- debian golang-1.26 (Debian): All versions (No fix recorded) \| \< 1.26.11-1
- debian golang-1.27 (Debian): All versions (No fix recorded) \| \< 1.27.4-1
- ubuntu golang-1.10 (Ubuntu): All versions (No fix recorded)
- ubuntu golang-1.13 (Ubuntu): All versions (No fix recorded)
- ubuntu golang-1.14 (Ubuntu): All versions (No fix recorded)
- ubuntu golang-1.16 (Ubuntu): All versions (No fix recorded)
- ubuntu golang-1.17 (Ubuntu): All versions (No fix recorded)
- ubuntu golang-1.18 (Ubuntu): All versions (No fix recorded)
- ubuntu golang-1.20 (Ubuntu): All versions (No fix recorded)
- ubuntu golang-1.21 (Ubuntu): All versions (No fix recorded)
- ubuntu golang-1.22 (Ubuntu): All versions (No fix recorded)
- ubuntu golang-1.23 (Ubuntu): All versions (No fix recorded)
- ubuntu golang-1.24 (Ubuntu): All versions (No fix recorded)
- ubuntu golang-1.25 (Ubuntu): All versions (No fix recorded)
- ubuntu golang-1.26 (Ubuntu): All versions (No fix recorded)
- ubuntu golang-1.27 (Ubuntu): All versions (No fix recorded)
- ubuntu golang-1.6 (Ubuntu): All versions (No fix recorded)

## References

- <https://security-tracker.debian.org/tracker/CVE-2026-97042>
- <https://go.dev/cl/862155>
- <https://go.dev/issue/82568>
- <https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM>
- <https://pkg.go.dev/vuln/GO-2026-6849>
- <https://ubuntu.com/security/CVE-2026-97042>
- <https://www.cve.org/CVERecord?id=CVE-2026-97042>
- <https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM/m/KsU1KfWgAQAJ>
- <https://github.com/golang/go/issues/82568>
- <https://github.com/golang/go/commit/e6ea940f9b93b14860aae5d4af996df4f44d0749>
- <https://github.com/golang/go/commit/29cb161249d3fab2ecdf390c1ba10cdf2ed8f02c>
- <https://security.alpinelinux.org/vuln/CVE-2026-97042>

---

Data as of 2026-12-05T08:38:09.177Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
