# CVE-2026-97035: Unexpected code execution and arbitrary file write via Clang -gen-\* and GCC -gnat\* flags in cgo in cmd/go

- 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-17
- Aliases: DEBIAN-CVE-2026-97035, GO-2026-6856, UBUNTU-CVE-2026-97035, ALPINE-CVE-2026-97035, CGA-22m5-c2vx-rf4j, CGA-255q-6q22-fhq5, CGA-33xw-hx7h-wp3v, CGA-3gfx-24h5-j35p, CGA-3h9q-hpj4-j84h, CGA-4g33-wf79-xpvj, CGA-4qqc-c3m6-h568, CGA-5jg7-qf6j-cf62, CGA-6255-54hc-3ggr, CGA-656v-hqh9-cw8p, CGA-6v7v-q8jj-j2rc, CGA-6vgm-j938-qf5c, CGA-7263-2f9j-9rv5, CGA-7j32-hgfc-h4jp, CGA-7xj5-gwvc-cxcv, CGA-8423-57x7-fjv9, CGA-89r4-8qq9-6vqx, CGA-8fcv-2896-7735, CGA-97w7-vf79-26gv, CGA-9fxm-ppjf-3mcw, CGA-9m7m-x9xx-hv2c, CGA-9p7j-5h3p-p73m, CGA-g499-2qg5-8jhv, CGA-grgp-fgwh-r2v9, CGA-gwhv-2xqc-r52c, CGA-h3jw-3fqf-62r7, CGA-hgm7-3p47-4542, CGA-j89w-fwvq-wgvq, CGA-jg4m-r67m-g782, CGA-jwh8-46m7-g7q4, CGA-mfg6-c373-mvp5, CGA-mh59-q672-2432, CGA-pcfx-m798-63g8, CGA-qf39-2343-hfgx, CGA-qhg4-54x7-wjjc, CGA-qpvw-23rw-3pxr, CGA-vx5x-55g5-qm5m, CGA-w5cr-hjr6-53x3, CGA-whjm-6fg4-rw79, CGA-x35m-hhf7-8qhw, CGA-238m-4rw8-67cm, CGA-279p-7mhq-f79v, CGA-27m4-5p3w-r76q, CGA-296x-crrc-c23m, CGA-29fv-h4rp-x2fr, CGA-2fw2-983m-xcw9, CGA-2m62-26px-wgrg, CGA-2mch-9cvf-36rp, CGA-2qvq-34hc-9qjj, CGA-2v28-f4wj-v5qw, CGA-32c4-3xp2-5vfm, CGA-33x9-8cgc-p8m4, CGA-3463-gpmq-qm6q, CGA-352r-g94m-9cpx, CGA-35hc-p78g-r5v3, CGA-372j-jvxm-6864, CGA-374x-43w4-c289, CGA-37vw-wv2j-vr3h, CGA-37x9-cq25-qq7g, CGA-39hx-jrf2-xxw5, CGA-3c3f-p5xv-wc45, CGA-3c3w-q3xh-qfv4, CGA-3c54-gpjm-j356, CGA-3c7w-g4v6-5r4m, CGA-3h6j-82f6-56g9, CGA-3h77-565r-cvh2, CGA-3j9p-m34f-78fh, CGA-3jff-rw95-7x2r, CGA-3mc9-2g9j-8xhp, CGA-3xx8-h626-wwr9, CGA-43jg-j37q-h8xf, CGA-43x5-wmcq-8mfc, CGA-4648-77fp-6qvf, CGA-4cp9-jg2p-9r6p, CGA-4h2w-p423-w6gq, CGA-4p83-77qr-x4p6, CGA-55mf-42hw-6qh2, CGA-56x4-v6m4-fchf, CGA-5c5p-4vp9-xh2m, CGA-5cc7-p8xf-2qph, CGA-5qg8-2963-6m3g, CGA-5qvj-hv7j-g3j7, CGA-5rr2-rxvw-xjpv, CGA-5vfq-hjr6-rvjx, CGA-6254-4hc6-m88v, CGA-68c3-p5q3-557j, CGA-68w5-9h58-9c63, CGA-69x4-p62m-9gqv, CGA-6c6h-6788-7984, CGA-6hhf-r7x8-3r56, CGA-6hhh-v2fm-h54r, CGA-6jrc-x3cg-mjg6, CGA-6pxm-vf5g-vf73, CGA-6xg6-j2fw-6wch, CGA-6xp8-x97j-xp3w, CGA-74j4-xjjj-hhhm, CGA-75h4-gfp5-5v77, CGA-75x4-3wqq-cw88, CGA-76g2-mj46-q8vh, CGA-78vp-h377-mrjp, CGA-7c99-9xhw-rmv3, CGA-7jr9-c9px-26rh, CGA-7m52-38gv-w54x, CGA-7pv9-qv7j-h3p3, CGA-7wp6-28mq-32vf, CGA-822m-jwmc-mmhm, CGA-832c-w5h3-55qv, CGA-8655-cf96-qwg5, CGA-869c-5chx-mg9c, CGA-883x-8c27-v64x, CGA-88mc-pg4q-v6xf, CGA-88mx-4688-5299, CGA-8jpg-7789-p36j, CGA-8jwp-7gmh-xx64, CGA-8mqp-7rp7-jrqq, CGA-8mxh-g5vp-rrvf, CGA-8qg2-97x7-rh6g, CGA-8qm4-m6jm-q528, CGA-8x3r-p855-8692, CGA-986x-qjpx-hjc8, CGA-9958-767f-c7x6, CGA-99vg-vvhc-23ph, CGA-9c96-jg38-w8r5, CGA-9g6f-jwm7-23ww, CGA-9gjr-v88w-735f, CGA-9hrp-hgqr-5qvp, CGA-9jff-29q7-hw74, CGA-9jwc-jmjc-3whv, CGA-9m9v-j9j7-r4mp, CGA-9v74-g2vh-6p49, CGA-9wg4-3vfw-326q, CGA-9x7m-c88p-7qw9, CGA-c2fq-x2c9-8cpq, CGA-c2p4-hwx2-4423, CGA-c2x7-3m4h-86xc, CGA-c3c7-wfcc-ppjm, CGA-c5f5-qcf8-2x7m, CGA-c696-7rcf-vc75, CGA-c6gp-4whr-jj8w, CGA-c9fp-fqw3-wjf3, CGA-ccgf-wq6p-6p3c, CGA-cf6m-cfhf-vj37, CGA-cfj7-hpp6-hm7m, CGA-cg3r-5x42-pjfw, CGA-cgvr-9v56-cfm9, CGA-cp5j-5wrw-2wp8, CGA-cr5g-2645-hvf3, CGA-crvx-h79w-vm8p, CGA-cv4c-8467-hmpf, CGA-cvjm-c227-8j5p, CGA-cwgv-f3v2-92c2, CGA-cwj9-jpgx-xqqq, CGA-f3vx-54m4-p2xj, CGA-f8hj-gv9f-3c2f, CGA-fhf7-7w7v-j9f6, CGA-fhm8-36jh-qff6, CGA-fqwm-45g3-97h6, CGA-frjp-9f2w-2jjh, CGA-fvc5-x39j-x95w, CGA-fw2h-mq69-5mqw, CGA-fw6p-qvh3-ch7p, CGA-fxw6-q3px-h63p, CGA-g2hf-p8jg-prqf, CGA-g3j9-f2pm-phxh, CGA-g3vx-rq3r-fc3x, CGA-g44c-h669-qr9p, CGA-g49v-w6w4-f3x2, CGA-gf99-m5x3-jhxx, CGA-gg7j-q583-chf6, CGA-ggr2-2w26-58r4, CGA-ghwq-xcx4-x27j, CGA-gj5f-f9w7-gc78, CGA-gj63-cg3q-x23f, CGA-gm2w-8gm9-89h3, CGA-gmvh-fvwc-hvvm, CGA-gp54-fgcj-mvfc, CGA-gqf4-8mr3-7cg9, CGA-gqhv-qjwh-pg64, CGA-gvvv-69f9-gh5h, CGA-h2jq-c2jj-6463, CGA-h2w9-c9c8-5m84, CGA-h748-rjq2-jjf9, CGA-h768-jjr9-24v2, CGA-hhg3-7qqq-mj4h, CGA-hqqj-p4mv-v2c5, CGA-hr29-fwfj-5wxv, CGA-hrvg-4698-f4jg, CGA-hv6c-4q2x-25f7, CGA-hxxv-gv8r-9gc8, CGA-j2h5-pj75-h72m, CGA-j3xr-q25x-6xwh, CGA-j4x7-vrh9-q4r3, CGA-j726-v77h-37r9, CGA-j7cr-cmcw-gjx6, CGA-j879-ff9m-75cc, CGA-j969-cfx5-xm89, CGA-j9rh-rvj7-9w22, CGA-jhmg-6f7j-34vq, CGA-jjxq-3mg3-hm36, CGA-jm99-hj7c-694j, CGA-jmrr-v8f5-7jcc, CGA-jqvw-869f-h7xh, CGA-jxpj-p5h2-9g46, CGA-m3mc-9prg-35w6, CGA-m44j-vmq2-p3j3, CGA-m6wc-988p-q96w, CGA-mg4r-xcxr-8x4q, CGA-mm56-w333-5g9g, CGA-mm9j-72pg-gf57, CGA-mmfx-h22w-ggmh, CGA-mmg6-893c-vmq7, CGA-mp7c-m952-m5gj, CGA-mwrv-43w6-rh5w, CGA-mxjg-h9pp-cwxx, CGA-mxp6-h9w7-788f, CGA-p5q3-64qq-phjx, CGA-p5x6-m7gp-97pq, CGA-p6xg-h5w5-jg3w, CGA-p76h-f7vh-c8g5, CGA-p9xx-7qvp-w654, CGA-pf7j-qgq8-chgx, CGA-pgqv-h5g6-rph6, CGA-ppjm-53v4-xxcr, CGA-pqjg-mf67-73mr, CGA-px58-hpgc-x4pr, CGA-px8p-jgqx-vw54, CGA-q2gw-ppgw-99rx, CGA-q335-gfh4-g78q, CGA-q8j5-3hpf-fr9g, CGA-q8jg-83rp-qjpm, CGA-q8x4-43mq-732q, CGA-qc4v-qgp2-54pm, CGA-qf4p-f4gp-43fw, CGA-qf7c-q862-fq84, CGA-qfr4-p9vf-7665, CGA-qh77-24m6-j9gc, CGA-qpfq-h5gx-43rp, CGA-qppp-43mc-rc7c, CGA-qqcp-p939-grp4, CGA-qvw3-frxq-ph8p, CGA-r26w-f56x-h43p, CGA-r3fq-f5v6-335v, CGA-r7x5-cx4j-8mhj, CGA-r8g3-hh8p-2x39, CGA-rcpq-74xv-3v4q, CGA-rg6v-9mc8-w892, CGA-rh3x-7f8c-3983, CGA-rmpp-r43h-96g6, CGA-rp37-qv6g-9cw2, CGA-rpfr-3g9f-8qqp, CGA-rq24-f4vf-xjjm, CGA-rq8w-3qph-9j6v, CGA-rqj3-gc6r-gq9f, CGA-rqq2-wx5j-9v42, CGA-rqrr-mff7-2f94, CGA-rr8x-6j52-4x5j, CGA-rvww-qmwf-77m5, CGA-rwmj-f2vh-8pqc, CGA-v3x3-mwm4-8p2g, CGA-v6xm-vfh9-465v, CGA-v94p-pxxw-pvxg, CGA-vfjg-ghf2-wc45, CGA-vfrj-xrv6-2gwx, CGA-vfxv-g64j-8h5w, CGA-vgc8-vjpr-rx72, CGA-vhcj-56q8-jxj2, CGA-vj4x-8824-fr3h, CGA-vmhh-9q48-r5c5, CGA-vmmv-6r23-qcvm, CGA-vqvm-rrj4-v273, CGA-vqwv-4887-wx56, CGA-vv4h-9g7x-gh54, CGA-vv83-5j4q-6w58, CGA-vvpv-crfv-x337, CGA-vxrq-hpm4-r8v5, CGA-vxwr-fpjv-9pmc, CGA-w2h7-572g-wc5p, CGA-w5cf-xmf2-jx49, CGA-w6w6-cjp6-48j2, CGA-w767-9cm7-fwhv, CGA-w8fh-8rvg-5535, CGA-wj67-qv3q-m3vf, CGA-wp8r-g654-267f, CGA-wqgh-2fr8-97wr, CGA-wrxm-3x7m-8vc7, CGA-ww4v-763q-wcm5, CGA-wwhg-v3m9-wp96, CGA-wx47-72q7-4jh3, CGA-x3rj-qgv4-cjqm, CGA-x4mf-wcv3-4r4f, CGA-x6rg-764c-8h6f, CGA-x765-rjqc-hhgq, CGA-x936-gx42-3wp8, CGA-xcvv-r2w8-cq7p, CGA-xfx9-69qf-rmr2, CGA-xjc7-vhmp-3hv3, CGA-xjf2-gxf9-w82v, CGA-xmw9-9vfq-rf24, CGA-xq5g-2w6w-657v, CGA-xqgh-fp7j-vgfm, CGA-xqq9-h38f-h72j, CGA-xqqr-7q6p-qj2f, CGA-xr37-8q9x-4rq9, CGA-xr56-fjrp-pgjg, CGA-xv4q-vhw2-w2xg, CGA-xw4w-wr72-9x2f, CGA-xxhh-7r82-p6m9, CGA-xxrq-wh95-pp66, CGA-3m9h-pg95-2vw2, CGA-3v9f-8887-qpxw, CGA-4x75-92j7-whhx, CGA-7gjr-q8fq-268v, CGA-3fx6-vf4w-rmw9, CGA-4xh2-fhc9-2fxr, CGA-c658-cxv5-g44v, CGA-j7cv-cw8q-82jg, BIT-golang-2026-97035, CGA-29jq-q429-w7rf, CGA-2gmc-xr43-59pf, CGA-3p6m-gc36-95ww, CGA-6gg8-jwcw-mf2x, CGA-7pc3-9mmg-7m3p, CGA-9m3m-85x4-9rr7, CGA-cmc7-hq4j-vpj5, CGA-hh3v-q94w-c4fp, CGA-pm8q-7f7v-r28p, CGA-vf2v-44q8-wj3c, CGA-cxgh-xv7r-2wv5, CGA-q26v-mqrq-vcmj, CGA-qmpp-c385-3h7r, CGA-qv58-88ff-3fjf
- Record: https://cvemate.com/vulnerability/CVE-2026-97035 · JSON: https://cvemate.com/vulnerability/CVE-2026-97035/json

## Description

```text
When using Clang or GCC, building a malicious package that uses cgo could cause unexpected code execution at build time or write files to arbitrary directories via "-gen-*" or "-gnat*" flags in "#cgo" directives. The "-g*" wildcard in the compiler and linker flag allowlists previously matched Clang's two-argument "-gen-cdb-fragment-path <dir>" flag and GCC's two-argument "-gnatO <file>" flag, permitting compilation database fragments and sidecar output files to be written to arbitrary directories and desynchronizing flag argument parsing between the go command and the compiler driver so that subsequent arguments could be passed as unvalidated positional inputs to the linker. "-gen-*" and "-gnat*" flags are now disallowed in "#cgo" compiler and linker flags.
```

## 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.706%, percentile 54.761%, 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)
- chainguard commercial-grafana-13.2 (Chainguard): All versions (No fix recorded) \| \< 13.2.7-r0

## References

- <https://security-tracker.debian.org/tracker/CVE-2026-97035>
- <https://go.dev/cl/862148>
- <https://go.dev/issue/82575>
- <https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM>
- <https://pkg.go.dev/vuln/GO-2026-6856>
- <https://ubuntu.com/security/CVE-2026-97035>
- <https://www.cve.org/CVERecord?id=CVE-2026-97035>
- <https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM/m/KsU1KfWgAQAJ>
- <https://github.com/golang/go/issues/82575>
- <https://github.com/golang/go/commit/cbd457366f9912bfbf32bc001d48fa458ff9e3e8>
- <https://github.com/golang/go/commit/b16449729837b6134cc225e83164df6337d5b5c3>
- <https://security.alpinelinux.org/vuln/CVE-2026-97035>

---

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