Vulnerability
CVE-2026-97039
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.
357 advisories report this vulnerability, across 14 ecosystems.
Advisories in Wolfi
- CGA-22xj-jrm7-qpcq
- CGA-2jvv-623g-3qmp
- CGA-2pj2-rch6-rqp8
- CGA-2w87-3p98-2m83
- CGA-3xgq-qvp7-32xr
- CGA-422r-63p8-2gx8
- CGA-4gfx-2xvj-75f7
- CGA-4vgr-h35x-537c
- CGA-5w87-gv68-7j9w
- CGA-6f77-8f42-hx89
- CGA-6h64-jg2x-6j3x
- CGA-6p4w-g3ph-8m23
- CGA-779q-536j-jp62
- CGA-7m9m-m9pr-qrq8
- CGA-7w33-664q-7mwj
- CGA-7xmx-6h25-p528
- CGA-844c-hcfw-882r
- CGA-84fv-p735-r8vm
- CGA-8cpc-6c75-qxfm
- CGA-8fq2-74vm-w9jv
- CGA-99jw-c5q9-x698
- CGA-9hwj-cr2r-ffp9
- CGA-cp5h-r6w2-x384
- CGA-cw9h-82r6-72jw
- CGA-fmvf-fxc3-rx44
- CGA-g7cw-h94g-8rgc
- CGA-gqm6-9vpw-x7rw
- CGA-h9h7-gx3j-3v5m
- CGA-j82x-88jc-v72r
- CGA-jrw6-97hm-c338
- CGA-m5hm-5rj7-rmf2
- CGA-p23x-vv4x-vpxf
- CGA-pmx9-x6cv-x3xc
- CGA-qgx7-98jh-8v59
- CGA-qjqq-vw39-pwf8
- CGA-rhgf-wqq4-f4j9
- CGA-rjrf-v2h6-2vmw
- CGA-w29c-r75v-xvrc
- CGA-wrg2-xmrr-h88r
- CGA-x732-hjx2-8589