Go言語のツールチェーンに脆弱性、悪意あるパッケージのビルドで任意のファイルを参照される
Summary
2026年11月11日に公表された、Go言語ツールチェーン(cmd/cgo・cmd/compile・cmd/link)の脆弱性です。悪意あるパッケージをWindowsでビルドすると、外部リンカーに不正なライブラリ引数が渡り、ディスク上の任意のファイルを参照されるおそれがあります。影響するのはGo 1.26.11より前とGo 1.27.0以上1.27.4未満で、修正版はGo 1.26.11とGo 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.
2026年11月11日に公表された、Go言語ツールチェーン(cmd/cgo・cmd/compile・cmd/link)の脆弱性です。悪意あるパッケージをWindowsでビルドすると、外部リンカーに不正なライブラリ引数が渡り、ディスク上の任意のファイルを参照されるおそれがあります。影響するのはGo 1.26.11より前とGo 1.27.0以上1.27.4未満で、修正版はGo 1.26.11とGo 1.27.4です。信頼できないパッケージをビルドする環境では、早めに修正版へ更新してください。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| Go toolchaincmd/cgo |
< 1.26.11→ 1.26.11 ≥ 1.27.0-0, < 1.27.4→ 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 |
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-97042 go Fix available
- BellSoft Alpaquita BELL-CVE-2026-97042 go Fix available
- Debian DEBIAN-CVE-2026-97042 golang-1.27, golang-1.26 Fix available
- Ubuntu UBUNTU-CVE-2026-97042 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.
Building a malicious package that uses "//go:cgo_import_dynamic" or links against a crafted PE object on Windows could pass unsafe library arguments to the external linker.
The compiler only checked the first character of the library name in "//go:cgo_import_dynamic" directives and skipped validation in cgo-generated files. In addition, on Windows, "cmd/cgo" and "cmd/link" did not validate imported DLL names extracted from PE object files before emitting "-l" flags for the external linker, allowing a crafted DLL name containing ".." path traversal or special characters to reference arbitrary files on disk.
The compiler now validates every character of the library name in "//go:cgo_import_dynamic" directives (including in cgo-generated files on Windows) and rejects ".." path traversal, and "cmd/cgo" and "cmd/link" reject PE imported DLL names containing path separators, "..", ":", or leading "-" or "@".
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