CVE-2024-24787 (GCVE-0-2024-24787)

Vulnerability from cvelistv5 – Published: 2024-05-08 15:31 – Updated: 2025-02-13 17:40
VLAI
Title
Arbitrary code execution during build on Darwin in cmd/go
Summary
On Darwin, building a Go module which contains CGO can trigger arbitrary code execution when using the Apple version of ld, due to usage of the -lto_library flag in a "#cgo LDFLAGS" directive.
SSVC
Exploitation: none Automatable: no Technical Impact: total
CISA Coordinator · CISA-ADP (v2.0.3)
Decision recorded 2024-06-05 14:49 UTC
CWE
  • CWE 74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Assigner
Impacted products
Vendor Product Version CPE status
Go toolchain cmd/go Affected: 0 , < 1.21.10 (semver)
Affected: 1.22.0-0 , < 1.22.3 (semver)
guessed Create a notification for this product.
golang go Affected: 1.21.0
Affected: 1.22
    cpe:2.3:a:golang:go:1.21.0:-:*:*:*:*:*:*
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "adp": [
      {
        "affected": [
          {
            "cpes": [
              "cpe:2.3:a:golang:go:1.21.0:-:*:*:*:*:*:*"
            ],
            "defaultStatus": "affected",
            "product": "go",
            "vendor": "golang",
            "versions": [
              {
                "status": "affected",
                "version": "1.21.0"
              },
              {
                "status": "affected",
                "version": "1.22"
              }
            ]
          }
        ],
        "metrics": [
          {
            "cvssV3_1": {
              "attackComplexity": "HIGH",
              "attackVector": "LOCAL",
              "availabilityImpact": "HIGH",
              "baseScore": 6.4,
              "baseSeverity": "MEDIUM",
              "confidentialityImpact": "HIGH",
              "integrityImpact": "HIGH",
              "privilegesRequired": "HIGH",
              "scope": "UNCHANGED",
              "userInteraction": "NONE",
              "vectorString": "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H",
              "version": "3.1"
            }
          },
          {
            "other": {
              "content": {
                "id": "CVE-2024-24787",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "total"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-06-05T14:49:29.014816Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-06-05T14:54:50.242Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-01T23:28:12.679Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://go.dev/issue/67119"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://go.dev/cl/583815"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://groups.google.com/g/golang-announce/c/wkkO4P9stm0"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://pkg.go.dev/vuln/GO-2024-2825"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://security.netapp.com/advisory/ntap-20240531-0006/"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "http://www.openwall.com/lists/oss-security/2024/05/08/3"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "collectionURL": "https://pkg.go.dev",
          "defaultStatus": "unaffected",
          "packageName": "cmd/go",
          "platforms": [
            "darwin"
          ],
          "product": "cmd/go",
          "vendor": "Go toolchain",
          "versions": [
            {
              "lessThan": "1.21.10",
              "status": "affected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThan": "1.22.3",
              "status": "affected",
              "version": "1.22.0-0",
              "versionType": "semver"
            }
          ]
        }
      ],
      "credits": [
        {
          "lang": "en",
          "value": "Juho Fors\u00e9n (Mattermost)"
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "On Darwin, building a Go module which contains CGO can trigger arbitrary code execution when using the Apple version of ld, due to usage of the -lto_library flag in a \"#cgo LDFLAGS\" directive."
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "description": "CWE 74: Improper Neutralization of Special Elements in Output Used by a Downstream Component (\u0027Injection\u0027)",
              "lang": "en"
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-06-10T16:10:10.782Z",
        "orgId": "1bb62c36-49e3-4200-9d77-64a1400537cc",
        "shortName": "Go"
      },
      "references": [
        {
          "url": "https://go.dev/issue/67119"
        },
        {
          "url": "https://go.dev/cl/583815"
        },
        {
          "url": "https://groups.google.com/g/golang-announce/c/wkkO4P9stm0"
        },
        {
          "url": "https://pkg.go.dev/vuln/GO-2024-2825"
        },
        {
          "url": "https://security.netapp.com/advisory/ntap-20240531-0006/"
        },
        {
          "url": "http://www.openwall.com/lists/oss-security/2024/05/08/3"
        }
      ],
      "title": "Arbitrary code execution during build on Darwin in cmd/go"
    }
  },
  "cveMetadata": {
    "assignerOrgId": "1bb62c36-49e3-4200-9d77-64a1400537cc",
    "assignerShortName": "Go",
    "cveId": "CVE-2024-24787",
    "datePublished": "2024-05-08T15:31:14.530Z",
    "dateReserved": "2024-01-30T16:05:14.758Z",
    "dateUpdated": "2025-02-13T17:40:26.439Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2024-24787",
      "date": "2026-09-25",
      "epss": "0.00766",
      "percentile": "0.53591"
    },
    "fkie_nvd": {
      "descriptions": [
        {
          "lang": "en",
          "value": "On Darwin, building a Go module which contains CGO can trigger arbitrary code execution when using the Apple version of ld, due to usage of the -lto_library flag in a \"#cgo LDFLAGS\" directive."
        },
        {
          "lang": "es",
          "value": "En Darwin, crear un m\u00f3dulo Go que contenga CGO puede desencadenar la ejecuci\u00f3n de c\u00f3digo arbitrario cuando se usa la versi\u00f3n Apple de ld, debido al uso del indicador -lto_library en una directiva \"#cgo LDFLAGS\"."
        }
      ],
      "id": "CVE-2024-24787",
      "lastModified": "2024-11-21T08:59:42.297",
      "metrics": {
        "cvssMetricV31": [
          {
            "cvssData": {
              "attackComplexity": "HIGH",
              "attackVector": "LOCAL",
              "availabilityImpact": "HIGH",
              "baseScore": 6.4,
              "baseSeverity": "MEDIUM",
              "confidentialityImpact": "HIGH",
              "integrityImpact": "HIGH",
              "privilegesRequired": "HIGH",
              "scope": "UNCHANGED",
              "userInteraction": "NONE",
              "vectorString": "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H",
              "version": "3.1"
            },
            "exploitabilityScore": 0.5,
            "impactScore": 5.9,
            "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
            "type": "Secondary"
          }
        ]
      },
      "published": "2024-05-08T16:15:08.183",
      "references": [
        {
          "source": "security@golang.org",
          "url": "http://www.openwall.com/lists/oss-security/2024/05/08/3"
        },
        {
          "source": "security@golang.org",
          "url": "https://go.dev/cl/583815"
        },
        {
          "source": "security@golang.org",
          "url": "https://go.dev/issue/67119"
        },
        {
          "source": "security@golang.org",
          "url": "https://groups.google.com/g/golang-announce/c/wkkO4P9stm0"
        },
        {
          "source": "security@golang.org",
          "url": "https://pkg.go.dev/vuln/GO-2024-2825"
        },
        {
          "source": "security@golang.org",
          "url": "https://security.netapp.com/advisory/ntap-20240531-0006/"
        },
        {
          "source": "af854a3a-2127-422b-91ae-364da2661108",
          "url": "http://www.openwall.com/lists/oss-security/2024/05/08/3"
        },
        {
          "source": "af854a3a-2127-422b-91ae-364da2661108",
          "url": "https://go.dev/cl/583815"
        },
        {
          "source": "af854a3a-2127-422b-91ae-364da2661108",
          "url": "https://go.dev/issue/67119"
        },
        {
          "source": "af854a3a-2127-422b-91ae-364da2661108",
          "url": "https://groups.google.com/g/golang-announce/c/wkkO4P9stm0"
        },
        {
          "source": "af854a3a-2127-422b-91ae-364da2661108",
          "url": "https://pkg.go.dev/vuln/GO-2024-2825"
        },
        {
          "source": "af854a3a-2127-422b-91ae-364da2661108",
          "url": "https://security.netapp.com/advisory/ntap-20240531-0006/"
        }
      ],
      "sourceIdentifier": "security@golang.org",
      "vulnStatus": "Awaiting Analysis"
    },
    "microsoft_vex": {
      "current_release_date": "2026-09-17T01:50:40.000Z",
      "cve": "CVE-2024-24787",
      "id": "msrc_CVE-2024-24787",
      "initial_release_date": "2025-09-03T19:45:02.000Z",
      "product_status:fixed": "4",
      "product_status:known_affected": "5",
      "product_status:known_not_affected": "19",
      "source": "Microsoft CSAF VEX",
      "status": "final",
      "title": "Arbitrary code execution during build on Darwin in cmd/go",
      "url": "https://msrc.microsoft.com/csaf/vex/2025/msrc_cve-2024-24787.json",
      "version": "7"
    },
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "collectionURL": "https://pkg.go.dev",
                "defaultStatus": "unaffected",
                "packageName": "cmd/go",
                "platforms": [
                  "darwin"
                ],
                "product": "cmd/go",
                "vendor": "Go toolchain",
                "versions": [
                  {
                    "lessThan": "1.21.10",
                    "status": "affected",
                    "version": "0",
                    "versionType": "semver"
                  },
                  {
                    "lessThan": "1.22.3",
                    "status": "affected",
                    "version": "1.22.0-0",
                    "versionType": "semver"
                  }
                ]
              }
            ],
            "source": "security@golang.org"
          },
          {
            "affectedData": [
              {
                "cpes": [
                  "cpe:2.3:a:golang:go:1.21.0:-:*:*:*:*:*:*"
                ],
                "defaultStatus": "affected",
                "product": "go",
                "vendor": "golang",
                "versions": [
                  {
                    "status": "affected",
                    "version": "1.21.0"
                  },
                  {
                    "status": "affected",
                    "version": "1.22"
                  }
                ]
              }
            ],
            "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0"
          }
        ],
        "cveTags": [],
        "descriptions": [
          {
            "lang": "en",
            "value": "On Darwin, building a Go module which contains CGO can trigger arbitrary code execution when using the Apple version of ld, due to usage of the -lto_library flag in a \"#cgo LDFLAGS\" directive."
          },
          {
            "lang": "es",
            "value": "En Darwin, crear un m\u00f3dulo Go que contenga CGO puede desencadenar la ejecuci\u00f3n de c\u00f3digo arbitrario cuando se usa la versi\u00f3n Apple de ld, debido al uso del indicador -lto_library en una directiva \"#cgo LDFLAGS\"."
          }
        ],
        "id": "CVE-2024-24787",
        "lastModified": "2026-06-17T07:14:51.640",
        "metrics": {
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "HIGH",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 6.4,
                "baseSeverity": "MEDIUM",
                "confidentialityImpact": "HIGH",
                "integrityImpact": "HIGH",
                "privilegesRequired": "HIGH",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 0.5,
              "impactScore": 5.9,
              "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
              "type": "Secondary"
            }
          ],
          "ssvcV203": [
            {
              "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
              "ssvcData": {
                "id": "CVE-2024-24787",
                "options": [
                  {
                    "exploitation": "none"
                  },
                  {
                    "automatable": "no"
                  },
                  {
                    "technicalImpact": "total"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-06-05T14:49:29.014816Z",
                "version": "2.0.3"
              }
            }
          ]
        },
        "published": "2024-05-08T16:15:08.183",
        "references": [
          {
            "source": "security@golang.org",
            "url": "http://www.openwall.com/lists/oss-security/2024/05/08/3"
          },
          {
            "source": "security@golang.org",
            "url": "https://go.dev/cl/583815"
          },
          {
            "source": "security@golang.org",
            "url": "https://go.dev/issue/67119"
          },
          {
            "source": "security@golang.org",
            "url": "https://groups.google.com/g/golang-announce/c/wkkO4P9stm0"
          },
          {
            "source": "security@golang.org",
            "url": "https://pkg.go.dev/vuln/GO-2024-2825"
          },
          {
            "source": "security@golang.org",
            "url": "https://security.netapp.com/advisory/ntap-20240531-0006/"
          },
          {
            "source": "af854a3a-2127-422b-91ae-364da2661108",
            "url": "http://www.openwall.com/lists/oss-security/2024/05/08/3"
          },
          {
            "source": "af854a3a-2127-422b-91ae-364da2661108",
            "url": "https://go.dev/cl/583815"
          },
          {
            "source": "af854a3a-2127-422b-91ae-364da2661108",
            "url": "https://go.dev/issue/67119"
          },
          {
            "source": "af854a3a-2127-422b-91ae-364da2661108",
            "url": "https://groups.google.com/g/golang-announce/c/wkkO4P9stm0"
          },
          {
            "source": "af854a3a-2127-422b-91ae-364da2661108",
            "url": "https://pkg.go.dev/vuln/GO-2024-2825"
          },
          {
            "source": "af854a3a-2127-422b-91ae-364da2661108",
            "url": "https://security.netapp.com/advisory/ntap-20240531-0006/"
          }
        ],
        "sourceIdentifier": "security@golang.org",
        "vulnStatus": "Deferred"
      }
    },
    "redhat_vex": {
      "current_release_date": "2025-05-28T19:54:38+00:00",
      "cve": "CVE-2024-24787",
      "id": "CVE-2024-24787",
      "initial_release_date": "2024-01-01T00:00:00+00:00",
      "product_status:known_not_affected": "1",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "Arbitrary code execution during build on Darwin in cmd/go",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2024/cve-2024-24787.json",
      "version": "3"
    },
    "suse_vex": {
      "aggregate_severity": "moderate",
      "current_release_date": "2026-08-31T00:47:06Z",
      "cve": "CVE-2024-24787",
      "id": "CVE-2024-24787",
      "initial_release_date": "2024-05-08T02:50:46Z",
      "product_status:known_not_affected": "163",
      "product_status:recommended": "170",
      "source": "SUSE CSAF VEX",
      "status": "interim",
      "title": "SUSE CVE CVE-2024-24787",
      "url": "https://ftp.suse.com/pub/projects/security/csaf-vex/cve-2024-24787.json",
      "version": "28"
    },
    "vulnrichment": {
      "containers": {
        "adp": [
          {
            "providerMetadata": {
              "dateUpdated": "2024-08-01T23:28:12.679Z",
              "orgId": "af854a3a-2127-422b-91ae-364da2661108",
              "shortName": "CVE"
            },
            "references": [
              {
                "tags": [
                  "x_transferred"
                ],
                "url": "https://go.dev/issue/67119"
              },
              {
                "tags": [
                  "x_transferred"
                ],
                "url": "https://go.dev/cl/583815"
              },
              {
                "tags": [
                  "x_transferred"
                ],
                "url": "https://groups.google.com/g/golang-announce/c/wkkO4P9stm0"
              },
              {
                "tags": [
                  "x_transferred"
                ],
                "url": "https://pkg.go.dev/vuln/GO-2024-2825"
              },
              {
                "tags": [
                  "x_transferred"
                ],
                "url": "https://security.netapp.com/advisory/ntap-20240531-0006/"
              },
              {
                "tags": [
                  "x_transferred"
                ],
                "url": "http://www.openwall.com/lists/oss-security/2024/05/08/3"
              }
            ],
            "title": "CVE Program Container"
          },
          {
            "affected": [
              {
                "cpes": [
                  "cpe:2.3:a:golang:go:1.21.0:-:*:*:*:*:*:*"
                ],
                "defaultStatus": "affected",
                "product": "go",
                "vendor": "golang",
                "versions": [
                  {
                    "status": "affected",
                    "version": "1.21.0"
                  },
                  {
                    "status": "affected",
                    "version": "1.22"
                  }
                ]
              }
            ],
            "metrics": [
              {
                "cvssV3_1": {
                  "attackComplexity": "HIGH",
                  "attackVector": "LOCAL",
                  "availabilityImpact": "HIGH",
                  "baseScore": 6.4,
                  "baseSeverity": "MEDIUM",
                  "confidentialityImpact": "HIGH",
                  "integrityImpact": "HIGH",
                  "privilegesRequired": "HIGH",
                  "scope": "UNCHANGED",
                  "userInteraction": "NONE",
                  "vectorString": "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H",
                  "version": "3.1"
                }
              },
              {
                "other": {
                  "content": {
                    "id": "CVE-2024-24787",
                    "options": [
                      {
                        "Exploitation": "none"
                      },
                      {
                        "Automatable": "no"
                      },
                      {
                        "Technical Impact": "total"
                      }
                    ],
                    "role": "CISA Coordinator",
                    "timestamp": "2024-06-05T14:49:29.014816Z",
                    "version": "2.0.3"
                  },
                  "type": "ssvc"
                }
              }
            ],
            "providerMetadata": {
              "dateUpdated": "2024-06-05T14:53:02.626Z",
              "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
              "shortName": "CISA-ADP"
            },
            "title": "CISA ADP Vulnrichment"
          }
        ],
        "cna": {
          "affected": [
            {
              "collectionURL": "https://pkg.go.dev",
              "defaultStatus": "unaffected",
              "packageName": "cmd/go",
              "platforms": [
                "darwin"
              ],
              "product": "cmd/go",
              "vendor": "Go toolchain",
              "versions": [
                {
                  "lessThan": "1.21.10",
                  "status": "affected",
                  "version": "0",
                  "versionType": "semver"
                },
                {
                  "lessThan": "1.22.3",
                  "status": "affected",
                  "version": "1.22.0-0",
                  "versionType": "semver"
                }
              ]
            }
          ],
          "credits": [
            {
              "lang": "en",
              "value": "Juho Fors\u00e9n (Mattermost)"
            }
          ],
          "descriptions": [
            {
              "lang": "en",
              "value": "On Darwin, building a Go module which contains CGO can trigger arbitrary code execution when using the Apple version of ld, due to usage of the -lto_library flag in a \"#cgo LDFLAGS\" directive."
            }
          ],
          "problemTypes": [
            {
              "descriptions": [
                {
                  "description": "CWE 74: Improper Neutralization of Special Elements in Output Used by a Downstream Component (\u0027Injection\u0027)",
                  "lang": "en"
                }
              ]
            }
          ],
          "providerMetadata": {
            "dateUpdated": "2024-06-10T16:10:10.782Z",
            "orgId": "1bb62c36-49e3-4200-9d77-64a1400537cc",
            "shortName": "Go"
          },
          "references": [
            {
              "url": "https://go.dev/issue/67119"
            },
            {
              "url": "https://go.dev/cl/583815"
            },
            {
              "url": "https://groups.google.com/g/golang-announce/c/wkkO4P9stm0"
            },
            {
              "url": "https://pkg.go.dev/vuln/GO-2024-2825"
            },
            {
              "url": "https://security.netapp.com/advisory/ntap-20240531-0006/"
            },
            {
              "url": "http://www.openwall.com/lists/oss-security/2024/05/08/3"
            }
          ],
          "title": "Arbitrary code execution during build on Darwin in cmd/go"
        }
      },
      "cveMetadata": {
        "assignerOrgId": "1bb62c36-49e3-4200-9d77-64a1400537cc",
        "assignerShortName": "Go",
        "cveId": "CVE-2024-24787",
        "datePublished": "2024-05-08T15:31:14.530Z",
        "dateReserved": "2024-01-30T16:05:14.758Z",
        "dateUpdated": "2025-02-13T17:40:26.439Z",
        "state": "PUBLISHED"
      },
      "dataType": "CVE_RECORD",
      "dataVersion": "5.1"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…