# CVE-2026-97039: Flag sanitization bypass via "\#cgo pkg-config:" directives in cmd/go

- Priority: **Routine**
- Reason: Not severe (CVSS 8.3, 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-97039, GO-2026-6852, UBUNTU-CVE-2026-97039, ALPINE-CVE-2026-97039, 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, CGA-22vh-hqgw-rjf3, CGA-2533-ccf4-68pc, CGA-28hf-4hg2-fw32, CGA-2jw7-535p-mr47, CGA-2qg5-28m9-9443, CGA-2vrg-2w7w-6325, CGA-2w74-2f8g-jv2f, CGA-2wp3-jm4j-c585, CGA-2x3h-rp3c-vjx9, CGA-389f-wx9r-9xr7, CGA-38r3-m25w-xxx5, CGA-3cm9-chg7-p279, CGA-3cp2-7rrx-5g8w, CGA-3f72-45wh-96pg, CGA-3p6g-45hj-xvmv, CGA-3pjr-52qg-f4r2, CGA-3r7q-v293-jj89, CGA-3w8j-g99q-g62c, CGA-3xmh-cvp9-q39g, CGA-3xmj-hg7w-2j7q, CGA-42cv-5w8m-qpfj, CGA-432p-hgwf-52qp, CGA-454w-9h6v-9prw, CGA-46qq-jrrg-5jx6, CGA-478p-7xq9-8fg8, CGA-49vf-7549-hjg9, CGA-4gxh-77w6-x3q3, CGA-4jmf-mrp3-xfw9, CGA-4pqj-xp88-2h9f, CGA-4qq8-q772-99q2, CGA-4qqf-3wj2-5688, CGA-4x29-4rc7-fxvw, CGA-4xq9-37ph-gj7f, CGA-523r-q67p-f8jg, CGA-5543-2jwq-hgvw, CGA-57f4-568m-hq6r, CGA-58mf-h6j8-fggm, CGA-5g43-hcm8-x3pj, CGA-5h3g-hx66-f99h, CGA-5jpg-4x5v-34rw, CGA-5mfx-8935-9mjp, CGA-5pvj-pjwg-j3v6, CGA-5r29-xvf4-x742, CGA-5rpq-c82c-6r3h, CGA-5v62-574r-jg7m, CGA-5vwx-6r45-cmj5, CGA-638g-2f39-83pc, CGA-6494-rp8g-2rr6, CGA-668h-x579-frrh, CGA-685r-fmjq-57g3, CGA-692j-rh55-r527, CGA-6c9h-gph6-g7rp, CGA-6cvm-j335-jhmh, CGA-6f8p-pf76-8cff, CGA-6gxj-2jqw-7rcm, CGA-6hm9-gw54-mmvc, CGA-6pq5-486j-jx77, CGA-6q8j-gw4q-9hww, CGA-6qh9-3w2m-fcrf, CGA-6xf9-77gj-mpr5, CGA-7262-v683-2px8, CGA-72f3-qrx6-vc38, CGA-73qm-p962-q3r2, CGA-75xm-v7v3-j84m, CGA-7846-wm98-6jcc, CGA-7gmw-pwg7-fm7q, CGA-7j27-687g-697h, CGA-7pfg-252w-x4f7, CGA-7v28-6r98-793h, CGA-7v9x-p2wm-39x7, CGA-7vmm-qwv4-4q88, CGA-83fc-hg56-xc99, CGA-8633-6c48-67gp, CGA-8fxh-2qfm-q679, CGA-8g5f-5w4x-j7gw, CGA-8gjj-8rqm-rp3v, CGA-8jp5-425v-wmrq, CGA-8jpc-3vm5-84h5, CGA-8pgp-xhp9-2cp9, CGA-8wm6-w5gc-w894, CGA-956v-73w5-qh84, CGA-972c-8hp9-rfpm, CGA-988x-jfwm-qc98, CGA-98pm-prgr-2787, CGA-9h32-428p-6479, CGA-9h6f-3f99-q4j5, CGA-9ph5-mpm6-fx3j, CGA-9pp7-m44j-2x3g, CGA-9w6j-6v54-8x4w, CGA-9xgg-j678-jm22, CGA-c75j-g76g-hxxh, CGA-cfhr-xh23-wr2x, CGA-cqm3-9g8j-95v3, CGA-crfw-w55p-grx5, CGA-cv6f-f7j4-76hr, CGA-cw9v-4598-742q, CGA-cxwf-r4cv-q8wp, CGA-f2g6-2f7r-r55c, CGA-f3j7-x239-mf44, CGA-f4x3-25cc-mrw2, CGA-f5m9-6p6j-99p4, CGA-f8g6-96fq-v95r, CGA-f937-qmx7-mrh5, CGA-f955-hwc2-cq7m, CGA-f99m-74qw-r9hx, CGA-f9jg-gqvf-wh3q, CGA-fh2g-r8ff-gfrr, CGA-fmx4-h2w6-hqpg, CGA-fpq7-2383-ppr2, CGA-fw6x-2c4p-6qh9, CGA-fw7g-f7m6-qqrj, CGA-fwv6-9c83-hj4m, CGA-fwwg-9jq4-crw8, CGA-fxpc-p67m-xf8c, CGA-fxq5-6whw-h7gm, CGA-fxv6-pr79-x82g, CGA-g2v3-3qj5-224p, CGA-g47r-q62h-v6pc, CGA-g557-97x7-5cr7, CGA-g593-v32h-r889, CGA-g8rh-jf7q-xpgw, CGA-gc78-f4w6-5fc4, CGA-gcmf-7mgq-ch9p, CGA-gg7g-m867-8pcj, CGA-ggc4-5cfx-3rm7, CGA-ghjc-fh4p-56cv, CGA-gpgf-54qf-phrp, CGA-gq33-p6vh-qpv3, CGA-gwwp-2mfv-mp72, CGA-h3h2-qr4p-x3v5, CGA-h3qq-jqv8-4688, CGA-h62v-657w-32w8, CGA-h66q-mwvh-ghm7, CGA-h72h-4v3r-pqhx, CGA-h7pq-jhq2-52w9, CGA-h9c5-3rf2-8cxr, CGA-h9c6-xc2q-r4fh, CGA-hcmr-58w2-m35w, CGA-hcpf-p7g4-7w3h, CGA-hff2-qq8j-xcm6, CGA-hfvc-jwqx-3f3p, CGA-hg39-grr5-v7hc, CGA-hg6w-9vjg-vxrq, CGA-hh72-p4rv-47cw, CGA-hj8c-2xvv-rfm3, CGA-hmjh-mx8h-mh39, CGA-hp59-hmmg-755g, CGA-hrfw-x37f-85r6, CGA-hv89-pjqh-wf8c, CGA-hvhp-h69g-j3mr, CGA-hwvm-q2g4-w7q2, CGA-hxxw-xj79-qr3g, CGA-j328-hxrg-f97v, CGA-j5q9-2mrc-6c8x, CGA-j628-p7rh-g82j, CGA-j66r-c2qf-98v9, CGA-j6x7-gw8g-f7jv, CGA-j89j-f4gr-fq4w, CGA-j8xf-gp25-8978, CGA-j973-34c6-qvjc, CGA-jf4w-pv69-jp98, CGA-jgc9-5p5j-j28r, CGA-jhqr-vj6p-9h4m, CGA-jmg2-xc9p-xwv8, CGA-jrp3-462x-27x2, CGA-jv33-m9r7-mmp8, CGA-m675-5fcw-jxpj, CGA-m8vp-pjf9-xm69, CGA-m9vw-hc27-235v, CGA-mchj-xwxx-hh9c, CGA-mfxj-w5r9-7pfw, CGA-mg2j-wrv7-qf34, CGA-mg99-7x4j-pmhm, CGA-mgc4-fjgv-xggq, CGA-mggc-g97j-pj87, CGA-mgwj-pr8v-fg7p, CGA-mj4q-p7c6-chm2, CGA-mjw5-wxgf-383q, CGA-mjwr-3pcx-ff39, CGA-mm69-rrqv-5898, CGA-mp7j-cjj3-6x78, CGA-mqqm-m2j9-vmxp, CGA-mrf9-3qq3-qp8r, CGA-mv7v-x8qh-96mq, CGA-mvh8-6g44-pvp8, CGA-mwg3-92r6-4qmg, CGA-mwxq-4cv6-6434, CGA-mwxq-rv72-mhjg, CGA-p28p-27xf-gcfc, CGA-p5hw-79fh-xc2h, CGA-p79m-87hf-x9r3, CGA-p7vr-m63x-rfph, CGA-p8wj-r26q-h3ch, CGA-p975-4p8q-58rc, CGA-pc4x-fp26-f4rp, CGA-pfr8-wmqc-mggr, CGA-ph28-97qq-pfw7, CGA-ph5w-8c8c-j93g, CGA-pmxh-9xm8-v834, CGA-pphg-mx5w-x7mv, CGA-ppx6-vxjv-wg43, CGA-pqfj-r755-cgw7, CGA-pvfc-pv57-rxv2, CGA-q242-2hx3-g23c, CGA-q7qh-hqf7-r659, CGA-q827-v234-96m7, CGA-qf8p-5g9x-5xc5, CGA-qf9g-mv4h-7h5v, CGA-qf9p-x4rx-h7pr, CGA-qh2j-98rm-wrj6, CGA-qh4g-qv3r-5f67, CGA-qjgp-3xxp-735h, CGA-qm6v-6m9q-h56f, CGA-qq43-phpf-p6v7, CGA-qqjc-453w-ff9h, CGA-qv7r-q5gf-wwg6, CGA-qwq3-cxrg-px9m, CGA-r88j-6gf8-mvhp, CGA-rc3j-p3rp-7v3c, CGA-rfxf-4fq6-56ch, CGA-rh46-898j-w63p, CGA-rm8w-vvmr-m8gq, CGA-v5f9-fcv4-hc86, CGA-v6f2-r9pg-9f57, CGA-v6hh-5g3q-g575, CGA-v8c7-qpv8-4pv8, CGA-v9xj-x4qj-x67f, CGA-vcjp-fcfc-r5rr, CGA-vg4c-jjxw-5ghr, CGA-vh62-25jr-fvfh, CGA-vh7m-m2q3-w7gr, CGA-vj6g-4c3r-p29h, CGA-vjq3-v4p8-gv34, CGA-vq3w-48x6-64w4, CGA-vq6v-q3rv-7g8j, CGA-vqhw-f59q-rm6j, CGA-vrjx-j32w-2336, CGA-vwxj-gwp9-2m2x, CGA-w26v-q54x-wch8, CGA-w444-q753-4qc2, CGA-w48p-93g4-hcq9, CGA-w4gq-2g97-6c85, CGA-w5qv-47q3-c328, CGA-w7jf-8g57-4v2m, CGA-wh2v-f9c2-wccm, CGA-wp35-8jr4-6x4g, CGA-wvgq-vrf5-w6q6, CGA-wvhx-rxpr-2jw5, CGA-wvqc-9jpx-2cfj, CGA-wvwc-qj9c-vwcc, CGA-wxg3-6c66-x7fw, CGA-wxjx-25mc-rxqc, CGA-x2v2-hmfj-c6f2, CGA-x34h-4w2j-mcjj, CGA-x3wq-jfgc-2x99, CGA-x4rf-rhw6-hc53, CGA-x4x5-5m9r-4qm8, CGA-x575-7jwq-2g52, CGA-x82q-8rxx-mh82, CGA-x8rq-c4w3-42gh, CGA-x9c3-rxc8-fpc6, CGA-xf89-jxfr-g86x, CGA-xg28-7wcx-vfmp, CGA-xj2x-v9p3-px72, CGA-xmcf-h487-gwvj, CGA-xmg6-3v74-p9xw, CGA-xmxf-q8gf-m7cg, CGA-xr2q-fjpw-h79j, CGA-2c8x-34fc-3xh5, CGA-4mff-7x3x-f335, CGA-7ff7-q4h9-m5g5, CGA-pvgw-p5h8-cj6j, CGA-3g7j-7fj4-gw25, CGA-mcx5-8c7x-9672, CGA-mq6q-hxv7-mcgm, CGA-q48f-xhmx-47g9, BIT-golang-2026-97039, CGA-fc9g-j3xf-7523, CGA-3v96-mp49-2338, CGA-5jp3-qpv7-6fmv, CGA-8fqx-xrm3-22rg, CGA-8vw8-2rqw-cx23, CGA-gwr4-48q9-3vf9, CGA-h38h-v5p2-v35x, CGA-p3pp-xrf2-6qv6, CGA-r3jq-m6gj-2gx8, CGA-vc87-qq34-xf5x, CGA-wf8f-vgg9-hfh3, CGA-2gcc-22c8-8pp5, CGA-67j5-wcmj-j463, CGA-f92h-g27f-9rhv, CGA-gq2c-v4r8-c266
- Record: https://cvemate.com/vulnerability/CVE-2026-97039 · JSON: https://cvemate.com/vulnerability/CVE-2026-97039/json

## Description

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

## Signals

- CVSS: 8.3 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L
- EPSS: 0.488%, percentile 43.616%, 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 105)

- alpine go (Alpine Linux): \< 1.26.11-r0 \| \< 1.27.4-r0
- chainguard azure-service-operator (Chainguard): All versions (No fix recorded)
- chainguard commercial-chainloop-backend (Chainguard): All versions (No fix recorded)
- chainguard commercial-chainloop-cli (Chainguard): All versions (No fix recorded)
- chainguard commercial-expanso-edge (Chainguard): All versions (No fix recorded)
- chainguard commercial-gitlab-rails-ee-19.1 (Chainguard): All versions (No fix recorded) \| \< 19.1.11-r0
- chainguard commercial-gitlab-rails-ee-19.2 (Chainguard): All versions (No fix recorded) \| \< 19.2.11-r0
- chainguard commercial-gitlab-rails-ee-fips-19.1 (Chainguard): All versions (No fix recorded) \| \< 19.1.10-r5
- chainguard commercial-gitlab-rails-ee-fips-19.2 (Chainguard): All versions (No fix recorded) \| \< 19.2.11-r0
- chainguard commercial-gitlab-workhorse-ee-19.1 (Chainguard): All versions (No fix recorded) \| \< 19.1.11-r0
- chainguard commercial-gitlab-workhorse-ee-19.2 (Chainguard): All versions (No fix recorded) \| \< 19.2.10-r2
- chainguard commercial-gitlab-workhorse-ee-fips-19.1 (Chainguard): All versions (No fix recorded) \| \< 19.1.11-r0
- chainguard commercial-gitlab-workhorse-ee-fips-19.2 (Chainguard): All versions (No fix recorded) \| \< 19.2.10-r2
- chainguard commercial-grafana-11.6 (Chainguard): All versions (No fix recorded)
- chainguard commercial-grafana-12.2 (Chainguard): All versions (No fix recorded)
- chainguard commercial-grafana-12.3 (Chainguard): All versions (No fix recorded)
- chainguard commercial-grafana-12.4 (Chainguard): All versions (No fix recorded) \| \< 12.4.16-r0
- chainguard commercial-grafana-13.0 (Chainguard): All versions (No fix recorded) \| \< 13.0.14-r0
- chainguard commercial-grafana-13.1 (Chainguard): All versions (No fix recorded) \| \< 13.1.11-r0
- chainguard commercial-grafana-13.2 (Chainguard): All versions (No fix recorded) \| \< 13.2.7-r0

## References

- <https://security-tracker.debian.org/tracker/CVE-2026-97039>
- <https://go.dev/cl/862152>
- <https://go.dev/issue/82571>
- <https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM>
- <https://pkg.go.dev/vuln/GO-2026-6852>
- <https://ubuntu.com/security/CVE-2026-97039>
- <https://www.cve.org/CVERecord?id=CVE-2026-97039>
- <https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM/m/KsU1KfWgAQAJ>
- <https://github.com/golang/go/issues/82571>
- <https://github.com/golang/go/commit/e7b9584fecd027e03a2abd2be2bbde2a43b5c668>
- <https://github.com/golang/go/commit/616afe1c2c33babc697ee687e66e25af1aba51ad>
- <https://security.alpinelinux.org/vuln/CVE-2026-97039>

---

Data as of 2026-12-05T08:25:39.087Z. 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
