You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cmd/go: arbitrary code execution during build on darwin via "-l to_library" in cgo #82574
On Darwin, building a malicious package that uses cgo could cause arbitrary code
execution when using the Apple linker due to passing "-l to_library " in a
"#cgo LDFLAGS" directive.
The Apple linker recombines the separated arguments "-l" and "to_library" into
"-lto_library", which loads an arbitrary LTO plugin dynamic library at link
time.
The go command now disallows "-l" followed by "to_library" in "#cgo LDFLAGS",
rejects "-lazy_library", "-lazy_framework", "-load_hidden", "-library", and
"-library-path", and checks recombined "-l" arguments against disallowed linker
flags and patterns.
changed the title [-]security: fix CVE-2026-97036[/-][+]cmd/go: arbitrary code execution during build on darwin via "-l to_library" in cgo[/+]on Nov 10, 2026
Activity
nicholashusin commentedon Oct 26, 2026
Hi @gopherbot, please open backport issues for this security issue.
gopherbot commentedon Oct 26, 2026
Backport issue(s) opened: #82593 (for 1.26), #82594 (for 1.27).
Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.
gopherbot commentedon Nov 10, 2026
Change https://go.dev/cl/861526 mentions this issue:
[release-branch.go1.26] cmd/go: disallow separated -l flag followed by to_librarygopherbot commentedon Nov 10, 2026
Change https://go.dev/cl/861487 mentions this issue:
[release-branch.go1.27] cmd/go: disallow separated -l flag followed by to_library[release-branch.go1.27] cmd/go: disallow separated -l flag followed b…
[release-branch.go1.26] cmd/go: disallow separated -l flag followed b…
[-]security: fix CVE-2026-97036[/-][+]cmd/go: arbitrary code execution during build on darwin via "-l to_library" in cgo[/+]gopherbot commentedon Nov 10, 2026
Change https://go.dev/cl/862149 mentions this issue:
cmd/go: disallow separated -l flag followed by to_librarycmd/go: disallow separated -l flag followed by to_library