{"id":"CVE-2026-97039","aliases":["GO-2026-6852"],"title":"Flag sanitization bypass via \"#cgo pkg-config:\" directives in cmd/go","titleSource":"Go","descriptionSource":"OSV","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.","severity":"unknown","score":null,"published":"2026-11-11T02:51:11.000Z","modified":"2026-11-11T03:15:14.802Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"Go","name":"toolchain","sources":[{"name":"OSV · GO-2026-6852","url":"https://osv.dev/vulnerability/GO-2026-6852"}],"ranges":[{"events":[{"introduced":"0"},{"fixed":"1.26.11"},{"introduced":"1.27.0-0"},{"fixed":"1.27.4"}],"type":"SEMVER"}],"versions":[],"fixed":["1.26.11","1.27.4"]}],"sourceAffected":[],"references":["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"],"sources":[{"name":"CVE","id":"CVE-2026-97039","modified":"2026-11-11T03:13:15.684Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-97039"},{"name":"OSV","id":"GO-2026-6852","modified":"2026-11-11T03:15:14.802903591Z","url":"https://osv.dev/vulnerability/GO-2026-6852"}],"assessments":[],"cve":{"records":[{"id":"CVE-2026-97039","source":"Go","state":"PUBLISHED","reasons":[],"replacements":[],"disputed":false,"unsupportedWhenAssigned":false,"reserved":"2026-09-23T23:05:04.987Z","published":"2026-11-11T03:13:15.684Z","modified":"2026-11-11T03:13:15.684Z"}],"publishers":[{"name":"Go","role":"CNA","organizationId":"1bb62c36-49e3-4200-9d77-64a1400537cc","modified":"2026-11-11T03:13:15.684Z"}],"references":[{"url":"https://go.dev/cl/862152","tags":[],"source":"Go"},{"url":"https://go.dev/issue/82571","tags":[],"source":"Go"},{"url":"https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM","tags":[],"source":"Go"},{"url":"https://pkg.go.dev/vuln/GO-2026-6852","tags":[],"source":"Go"}],"weaknesses":[],"applicability":[],"prioritization":[]},"products":[{"vendor":"Go toolchain","name":"cmd/go","platforms":[],"versions":[{"version":"0","status":"affected","lessThan":"1.26.11","versionType":"semver"},{"version":"1.27.0-0","status":"affected","lessThan":"1.27.4","versionType":"semver"}],"defaultStatus":"unaffected","cpes":[],"source":"Go","url":"https://www.cve.org/CVERecord?id=CVE-2026-97039"}],"remediation":[],"observedAt":"2026-11-11T06:56:00.455Z","kev":{"status":"not-listed","checkedAt":"2026-11-14T23:35:33.875Z"},"coverage":[{"source":"NVD","status":"available","checkedAt":"2026-11-11T07:30:42.240Z","attemptedAt":"2026-11-11T07:30:42.240Z"},{"source":"GHSA","status":"available","checkedAt":"2026-11-11T07:30:42.055Z","attemptedAt":"2026-11-11T07:30:42.055Z"},{"source":"EUVD","status":"available","checkedAt":"2026-11-11T07:30:42.601Z","attemptedAt":"2026-11-11T07:30:42.601Z"},{"source":"EPSS","status":"no-result","checkedAt":"2026-11-11T07:30:41.322Z","attemptedAt":"2026-11-11T07:30:41.322Z"}],"evidence":[{"source":"GitHub Advisory Database","id":"GHSA-4x3g-87c5-vq62","url":"https://github.com/advisories/GHSA-4x3g-87c5-vq62","modified":"2026-11-11T06:32:47Z","checkedAt":"2026-11-11T07:30:42.055Z"},{"source":"NVD","id":"CVE-2026-97039","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-97039","modified":"2026-11-11T05:19:58.133","checkedAt":"2026-11-11T07:30:42.240Z"},{"source":"ENISA EUVD","id":"EUVD-2026-123106","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-123106","modified":"Nov 11, 2026, 6:32:38 AM","checkedAt":"2026-11-11T07:30:42.601Z"}],"aiSummary":null}