Go言語のcmd/goに脆弱性、悪意あるパッケージのビルドで任意のコマンドを実行されるおそれ
概要
GCCを使う環境で悪意のあるパッケージをcgoを使ってビルドすると、リンク時に任意のコマンドが実行されるおそれがあります。影響を受けるのはGo toolchainのcmd/goで、1.26.11より前の1.26系と、1.27.0以降1.27.4より前の版です。修正版の1.26.11と1.27.4が公開されているので、該当する版を使っている場合は更新してください。
AI要約
SecPulse が外部の生成 AI を使って作った要約です。誤りを含むことがあります。重要な判断の前に、下の原文と参照URLを確認してください。
GCCを使う環境で悪意のあるパッケージをcgoを使ってビルドすると、リンク時に任意のコマンドが実行されるおそれがあります。影響を受けるのはGo toolchainのcmd/goで、1.26.11より前の1.26系と、1.27.0以降1.27.4より前の版です。修正版の1.26.11と1.27.4が公開されているので、該当する版を使っている場合は更新してください。
影響パッケージ
| パッケージ | 影響を受ける版 → 修正版 | |
|---|---|---|
| Go toolchaincmd/go |
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-97034 go 修正版あり
- BellSoft Alpaquita BELL-CVE-2026-97034 go 修正版あり
- Debian DEBIAN-CVE-2026-97034 golang-1.27, golang-1.26 修正版あり
- Ubuntu UBUNTU-CVE-2026-97034 golang-1.27, golang-1.26, golang-1.25 ほか 14 件 この記録に修正版の記載なし
原文の説明 取得元が公開している説明をそのまま載せています (多くは英語)。
When using GCC, building a malicious package that uses cgo could cause arbitrary command execution at link time via untrusted GCC spec files ("specs" or "*.spec").
When linking with "-fopenmp", "-fopenacc", or "-fsanitize=" in "#cgo LDFLAGS", GCC's built-in link spec evaluates "%:include(libgomp.spec)" or "%:include(libsanitizer.spec)" and searches for spec files in "-L" and sysroot directories (including subdirectories and multilib sibling directories such as "../lib64"), as well as the working directory when "-fopenmp" or "-fopenacc" is used or when "-fsanitize=" is combined with "-static" or "-static-lib*".
The go command now rejects "-L", "-isysroot", and "-Wl,-syslibroot" directories (and the working and package directories when applicable) that contain GCC spec files, and disallows "@" and "-" prefixes in "-fsanitize=" compiler flag values.
出典: 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