Lucene search

K
cvelistGoCVELIST:CVE-2023-29405
HistoryJun 08, 2023 - 8:19 p.m.

CVE-2023-29405 Improper sanitization of LDFLAGS with embedded spaces in go command with cgo in cmd/go

2023-06-0820:19:19
Go
www.cve.org

9.9 High

AI Score

Confidence

High

0.002 Low

EPSS

Percentile

54.6%

The go command may execute arbitrary code at build time when using cgo. This may occur when running โ€œgo getโ€ on a malicious module, or when running any other command which builds untrusted code. This is can by triggered by linker flags, specified via a โ€œ#cgo LDFLAGSโ€ directive. Flags containing embedded spaces are mishandled, allowing disallowed flags to be smuggled through the LDFLAGS sanitization by including them in the argument of another flag. This only affects usage of the gccgo compiler.

CNA Affected

[
  {
    "vendor": "Go toolchain",
    "product": "cmd/go",
    "collectionURL": "https://pkg.go.dev",
    "packageName": "cmd/go",
    "versions": [
      {
        "version": "0",
        "lessThan": "1.19.10",
        "status": "affected",
        "versionType": "semver"
      },
      {
        "version": "1.20.0-0",
        "lessThan": "1.20.5",
        "status": "affected",
        "versionType": "semver"
      }
    ],
    "defaultStatus": "unaffected"
  },
  {
    "vendor": "Go toolchain",
    "product": "cmd/cgo",
    "collectionURL": "https://pkg.go.dev",
    "packageName": "cmd/cgo",
    "versions": [
      {
        "version": "0",
        "lessThan": "1.19.10",
        "status": "affected",
        "versionType": "semver"
      },
      {
        "version": "1.20.0-0",
        "lessThan": "1.20.5",
        "status": "affected",
        "versionType": "semver"
      }
    ],
    "defaultStatus": "unaffected"
  }
]