CVE-2026-97039
Last modified
CVE-2026-97039 is a vulnerability of currently unknown severity. Building a malicious package that uses "#cgo pkg-config:" directives could load untrusted pkg-config ".pc" files or inject unvalidated compiler and linker flags. The pkg-config flag allowlist previously permitted "--with-path=" and "--personality=", allowed "--define-variable=" values beginning with "=" or "$" (which can rewrite paths in system ".pc" files into sysroot-prefixed "-L=" or "-L$SYSROOT" linker search paths), and allowed package arguments ending in ".pc" or containing path separators or "..", which caused pkg-config to load local ".pc" files directly from the package directory. EPSS estimates a 0.23% chance of exploitation in the next 30 days.
Description
Building a malicious package that uses "#cgo pkg-config:" directives could load untrusted pkg-config ".pc" files or inject unvalidated compiler and linker flags. The pkg-config flag allowlist previously permitted "--with-path=" and "--personality=", allowed "--define-variable=" values beginning with "=" or "$" (which can rewrite paths in system ".pc" files into sysroot-prefixed "-L=" or "-L$SYSROOT" linker search paths), and allowed package arguments ending in ".pc" or containing path separators or "..", which caused pkg-config to load local ".pc" files directly from the package directory. In addition, flags returned by "pkg-config --cflags" in cgoCPPFLAGS were not checked when determining whether internal linking is safe. The go command now disallows "--with-path=", "--personality=", leading "=" or "$" characters in "--define-variable=" values, and local ".pc" paths in "#cgo pkg-config:" directives, and inspects cgoCPPFLAGS when checking internal linking compatibility.
Metrics
Weakness Enumeration
Affected Software
Source: CNA advisory (CVE.org). NVD analysis pending.
| Vendor | Product | Versions |
|---|---|---|
| Go toolchain | cmd/go | < 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-97039?
How severe is CVE-2026-97039?
How do I fix CVE-2026-97039?
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-97033Building a malicious package that uses cgo could cause arbit…
- CVE-2026-97034When using GCC, building a malicious package that uses cgo c…
- CVE-2026-97035When using Clang or GCC, building a malicious package that u…
- CVE-2026-97036On Darwin, building a malicious package that uses cgo could …
- 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-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-97042Building a malicious package that uses "//go:cgo_import_dyna…
- CVE-2026-97043Building a malicious package that uses cgo could bypass "#cg…
- CVE-2026-97045In childTextNodesAreLiteral, walking up the tree previously …6.1
Are you affected by CVE-2026-97039?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
