{"id":"CVE-2026-97039","aliases":["CVE-2026-97039","GO-2026-6852","BIT-GOLANG-2026-97039"],"related":["RHSA-2026:101231","RHSA-2026:102586","RHSA-2026:102587","RHSA-2026:102592","RHSA-2026:99003","RHSA-2026:99004"],"kind":"vulnerability","state":"published","title":"Flag sanitization bypass via \"#cgo pkg-config:\" directives in cmd/go","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"}],"published":"2026-11-11T02:51:11.000Z","modified":"2026-11-27T06:56:07.171Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L","score":8.3,"rating":"HIGH"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L","score":8.3,"rating":"HIGH"}],"cwes":["CWE-88"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"1.26.11","status":"affected"},{"type":"semver","introduced":"1.27.0-0","fixed":"1.27.4","status":"affected"}],"vendor":"Go toolchain","product":"cmd/go","package":"cmd/go","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.26.11"},{"type":"semver","introduced":"1.27.0-0","status":"affected","fixed":"1.27.4"}],"ecosystem":"Go","package":"toolchain","purl":"pkg:golang/toolchain","source":"go"}],"references":[{"url":"https://go.dev/cl/862152","tags":["fix"],"sources":["cvelist","go","nvd"]},{"url":"https://go.dev/issue/82571","tags":["report"],"sources":["cvelist","go","nvd"]},{"url":"https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM","tags":["web"],"sources":["cvelist","go","nvd"]},{"url":"https://pkg.go.dev/vuln/GO-2026-6852","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Go","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-11-16T17:27:36.966Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-97039","url":"https://www.cve.org/CVERecord?id=CVE-2026-97039","licence":"CVE Terms of Use","modified":"2026-11-16T17:27:40.616Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6852","url":"https://pkg.go.dev/vuln/GO-2026-6852","licence":"CC-BY-4.0","modified":"2026-11-27T06:56:07.171Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-97039","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-97039","licence":"Public domain","modified":"2026-11-16T18:17:33.960Z"}],"updatedAt":"2026-11-27T07:27:26.058Z","epss":{"score":0.00488,"percentile":0.43603,"date":"2026-12-01T12:00:22.000Z"}}