Skip to content

cmd/go: arbitrary code execution during build on darwin (fix CVE-2025-22867) #71476

@rolandshoemaker

Description

@rolandshoemaker

cmd/go: arbitrary code execution during build on darwin

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 @executable_path, @loader_path, or @rpath special values in a "#cgo LDFLAGS" directive.

This issue only affected go1.24rc2.

Thanks to Juho Forsén of Mattermost for reporting this issue.

This is CVE-2025-22867 and Go issue https://go.dev/issue/71476 (this issue).


This is a PRIVATE issue for CVE-2025-22867, tracked in http://b/390637555 and fixed by https://go-internal-review.git.corp.google.com/c/go/+/1900.

/cc @golang/security and @golang/release

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions