{"id":"CVE-2026-97039","aliases":["DEBIAN-CVE-2026-97039","EUVD-2026-123106","GHSA-4x3g-87c5-vq62","GO-2026-6852","openSUSE-SU-2026:12529-1"],"status":"published","title":"Flag sanitization bypass via \"#cgo pkg-config:\" directives in cmd/go","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.","epss":{"day":"2026-11-12","score":0.00234,"percentile":0.14451,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"published":"2026-11-11T00:00:00Z","modified":"2026-11-12T17:23:23Z","fixes":[{"ecosystem":"Go","package":"toolchain","fixed_in":["1.26.11","1.27.4"],"sources":["osv"]}],"affected":[{"source":"osv","ecosystem":"Debian:12","package":"golang-1.19","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.19.10-1","1.19.10-2","1.19.11-1","1.19.12-1","1.19.12-2","1.19.12-2~bpo11+1","1.19.12-2~bpo12+1","1.19.13-1","1.19.13-1~bpo11+1","1.19.13-1~bpo12+1","1.19.8-2","1.19.9-1"]},{"source":"osv","ecosystem":"Debian:13","package":"golang-1.24","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.24.12-1","1.24.13-1","1.24.13-2","1.24.4-1","1.24.4-2","1.24.4-3","1.24.4-4","1.24.7-1","1.24.8-1","1.24.9-1"]},{"source":"osv","ecosystem":"Debian:14","package":"golang-1.26","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.26.0-1","1.26.1-1","1.26.10-1","1.26.10-1~bpo13+1","1.26.11-1","1.26.2-1","1.26.2-2","1.26.2-3","1.26.3-1","1.26.3-1~bpo13+1","1.26.3-2","1.26.3-2~bpo13+1","1.26.4-1","1.26.4-1~bpo13+1","1.26.5-1","1.26.5-1~bpo13+1","1.26.6-1","1.26.6-2","1.26.7-1","1.26.7-1~bpo13+1","1.26.8-1","1.26.8-1~bpo13+1","1.26.8-2","1.26.9-1","1.26.9-1~bpo13+1","1.26~rc2-1","1.26~rc3-1","1.26~rc3-2"]},{"source":"osv","ecosystem":"Debian:14","package":"golang-1.27","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.27.0-1","1.27.0-1~bpo13+1","1.27.1-1","1.27.1-2","1.27.1-2~bpo13+1","1.27.2-1","1.27.2-1~bpo13+1","1.27.2-1~bpo13+2","1.27.3-1","1.27.3-1~bpo13+1","1.27.4-1","1.27~rc1-1","1.27~rc2-1","1.27~rc3-1"]},{"source":"osv","ecosystem":"Go","package":"toolchain","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.26.11"},{"introduced":"1.27.0-0"},{"fixed":"1.27.4"}]}]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"go1.26","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.26.11-1.1"}]}],"bundled":12}],"products":[{"vendor":"go toolchain","product":"cmd/go"}],"references":[{"url":"https://go.dev/cl/862152","tags":["fix"]},{"url":"https://go.dev/issue/82571","tags":["report"]},{"url":"https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM","tags":["web"]},{"url":"https://pkg.go.dev/vuln/GO-2026-6852"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-97039"},{"url":"https://github.com/advisories/GHSA-4x3g-87c5-vq62"},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-97039","tags":["advisory"]},{"url":"","tags":["advisory"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97033","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97034","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97035","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97036","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97037","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97038","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97039","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97040","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97041","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97042","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97043","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97054","tags":["web"]}],"sources":{"cve":[{"id":"CVE-2026-97039","title":"Flag sanitization bypass via \"#cgo pkg-config:\" directives in cmd/go","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.","status":"published","published":"2026-11-11T03:13:15.684Z","modified":"2026-11-11T03:13:15.684Z","updated_at":"2026-11-11T04:22:54.647883Z"}],"euvd":[{"id":"EUVD-2026-123106","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.","status":"published","published":"2026-11-11T03:13:15Z","modified":"2026-11-11T03:13:15Z","updated_at":"2026-11-11T08:27:52.334831Z"}],"ghsa":[{"id":"GHSA-4x3g-87c5-vq62","title":"Building a malicious package that uses \"#cgo pkg-config:\" directives could load untrusted pkg...","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.","status":"published","published":"2026-11-11T06:32:38Z","modified":"2026-11-11T06:32:47Z","updated_at":"2026-11-11T07:02:43.25695Z"}],"nvd":[{"id":"CVE-2026-97039","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.","status":"published","published":"2026-11-11T05:19:58.133Z","modified":"2026-11-11T05:19:58.133Z","updated_at":"2026-11-11T07:23:51.781546Z"}],"osv":[{"id":"DEBIAN-CVE-2026-97039","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.","status":"published","published":"2026-11-11T05:19:58.133Z","modified":"2026-11-11T07:47:34.478856771Z","updated_at":"2026-11-11T08:27:16.400656Z"},{"id":"GO-2026-6852","title":"Flag sanitization bypass via \"#cgo pkg-config:\" directives in cmd/go","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.\n\nThe 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.\n\nThe 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.","status":"published","published":"2026-11-11T02:51:11Z","modified":"2026-11-11T03:15:14.802903591Z","updated_at":"2026-11-11T03:52:51.074362Z"},{"id":"openSUSE-SU-2026:12529-1","title":"go1.26-1.26.11-1.1 on GA media","description":"These are all security issues fixed in the go1.26-1.26.11-1.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2026-11-11T00:00:00Z","modified":"2026-11-12T17:23:23.015967912Z","updated_at":"2026-11-12T18:02:05.26944Z"}]}}
