Go toolchainの脆弱性、悪意あるパッケージのビルドで任意のリンカーフラグを注入される
概要
Go toolchainには、「//go:cgo_*」指示子を含む悪意あるパッケージをビルドすると、ELF環境で外部リンカーに任意のフラグを注入されるおそれのある脆弱性が見つかっています。影響を受けるのは、cmd/compile・cmd/link・Go toolchainの1.26.11より前と、1.27.0以降1.27.4より前です。1.26.11または1.27.4以降に更新してください。
AI要約
SecPulse が外部の生成 AI を使って作った要約です。誤りを含むことがあります。重要な判断の前に、下の原文と参照URLを確認してください。
Go toolchainには、「//go:cgo_*」指示子を含む悪意あるパッケージをビルドすると、ELF環境で外部リンカーに任意のフラグを注入されるおそれのある脆弱性が見つかっています。影響を受けるのは、cmd/compile・cmd/link・Go toolchainの1.26.11より前と、1.27.0以降1.27.4より前です。1.26.11または1.27.4以降に更新してください。
影響パッケージ
| パッケージ | 影響を受ける版 → 修正版 | |
|---|---|---|
| Go toolchaincmd/compile |
1.26.11 未満→ 1.26.11 1.27.0-0 以上 1.27.4 未満→ 1.27.4 |
1.26.11 1.27.4 |
| Go toolchaincmd/link |
1.26.11 未満→ 1.26.11 1.27.0-0 以上 1.27.4 未満→ 1.27.4 |
1.26.11 1.27.4 |
| Gotoolchain |
1.26.11 未満→ 1.26.11 1.27.0-0 以上 1.27.4 未満→ 1.27.4 |
1.26.11 1.27.4 |
ディストリビューション別の修正状況
各ディストリビューションが公開している、この CVE の記録です。修正版は配布版ごとに違うので、リンク先で確かめてください。
- Alpine Linux ALPINE-CVE-2026-97041 go 修正版あり
- BellSoft Alpaquita BELL-CVE-2026-97041 go 修正版あり
- Debian DEBIAN-CVE-2026-97041 golang-1.27, golang-1.26 修正版あり
- Ubuntu UBUNTU-CVE-2026-97041 golang-1.27, golang-1.26, golang-1.25 ほか 14 件 この記録に修正版の記載なし
原文の説明 取得元が公開している説明をそのまま載せています (多くは英語)。
Building a malicious package containing "//go:cgo_*" compiler directives could inject arbitrary flags into the external linker invocation on ELF platforms.
The compiler and linker did not reject commas in "//go:cgo_import_dynamic", "//go:cgo_export_dynamic", "//go:cgo_export_static", "//go:cgo_import_static", and "//go:cgo_dynamic_linker" directives, and the linker passed the dynamic linker path using "-Wl,--dynamic-linker,". Furthermore, the two-argument form of "//go:cgo_import_dynamic" (which is permitted in non-cgo Go source files) could overwrite the external symbol name of a symbol already marked for cgo export. A symbol name or dynamic linker path containing a comma or leading "@" could split "-Wl,--export-dynamic-symbol=" or "-Wl,--dynamic-linker," into arbitrary host linker flags or response file arguments.
The compiler and linker now reject commas in "//go:cgo_*" symbol and dynamic linker directives, the linker passes "-Wl,--dynamic-linker=", and "cgo_import_dynamic" no longer overwrites symbols exported via "cgo_export_dynamic" or "cgo_export_static".
出典: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
参照URL
- patch go.dev
- report go.dev
- web groups.google.com
- web security@golang.org
- web nvd.nist.gov
- web github.com