Go言語のcmd/goに脆弱性、悪意あるパッケージのビルドで任意のコマンドを実行されるおそれ
Summary
GCCを使う環境で悪意のあるパッケージをcgoを使ってビルドすると、リンク時に任意のコマンドが実行されるおそれがあります。影響を受けるのはGo toolchainのcmd/goで、1.26.11より前の1.26系と、1.27.0以降1.27.4より前の版です。修正版の1.26.11と1.27.4が公開されているので、該当する版を使っている場合は更新してください。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
GCCを使う環境で悪意のあるパッケージをcgoを使ってビルドすると、リンク時に任意のコマンドが実行されるおそれがあります。影響を受けるのはGo toolchainのcmd/goで、1.26.11より前の1.26系と、1.27.0以降1.27.4より前の版です。修正版の1.26.11と1.27.4が公開されているので、該当する版を使っている場合は更新してください。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| 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 |
Fix status by distribution
Records published by each distribution for this CVE. Fixed versions differ by release; check each link.
- Alpine Linux ALPINE-CVE-2026-97034 go Fix available
- BellSoft Alpaquita BELL-CVE-2026-97034 go Fix available
- Debian DEBIAN-CVE-2026-97034 golang-1.27, golang-1.26 Fix available
- Ubuntu UBUNTU-CVE-2026-97034 golang-1.27, golang-1.26, golang-1.25 +14 more No fixed version in this record
Original description The description as published by the source.
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.
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- patch go.dev
- report go.dev
- web groups.google.com
- web security@golang.org
- web nvd.nist.gov
- web github.com