Go 1.17.5 のリリース【セキュリティ・アップデート】
Go 1.17.5 がリリースされた。
今回は2件の脆弱性修正を含んでいる。
go1.17.5 (released 2021-12-09) includes security fixes to the.syscall
andnet/http
packages. See the Go 1.17.5 milestone on our issue tracker for details
CVE-2021-44716: net/http: limit growth of header canonicalization cache
An attacker can cause unbounded memory growth in a Go server accepting HTTP/2 requests.
For users who cannot immediately update to the new release, setting the
GODEBUG=http2server=0
environment variable before calling Serve will disable HTTP/2 unless it was manually configured through thegolang.org/x/net/http2
package.This issue is also fixed in
golang.org/x/net/http2
v0.0.0-20211209124913-491a49abca63
, for users manually configuring HTTP/2.
というわけで golang.org/x/net/http2
パッケージを使っている場合は,こちらも要アップデートだな。
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- 深刻度: 重要 (Score: 7.5)
基本評価基準 | 評価値 |
---|---|
攻撃元区分 | ネットワーク |
攻撃条件の複雑さ | 低 |
必要な特権レベル | 不要 |
ユーザ関与レベル | 不要 |
スコープ | 変更なし |
機密性への影響 | なし |
完全性への影響 | なし |
可用性への影響 | 高 |
CVE-2021-44717: syscall: don’t close fd 0 on ForkExec error
When a Go program running on a Unix system is out of file descriptors and calls
syscall.ForkExec
(including indirectly by using theos/exec
package),syscall.ForkExec
can close file descriptor 0 as it fails. If this happens (or can be provoked) repeatedly, it can result in misdirected I/O such as writing network traffic intended for one connection to a different connection, or content intended for one file to a different one.For users who cannot immediately update to the new release, the bug can be mitigated by raising the per-process file descriptor limit.
これはちょっとヤバいかな。
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
- 深刻度: 警告 (Score: 4.8)
基本評価基準 | 評価値 |
---|---|
攻撃元区分 | ネットワーク |
攻撃条件の複雑さ | 高 |
必要な特権レベル | 不要 |
ユーザ関与レベル | 不要 |
スコープ | 変更なし |
機密性への影響 | 低 |
完全性への影響 | 低 |
可用性への影響 | なし |
例によって…
Ubuntu の APT で管理している Go コンパイラは古いので,ダウンロードページからバイナリ(go1.17.5.linux-amd64.tar.gz
)を取ってきてインストールすることを強く推奨する。
以下は完全手動での作業例。
$ cd /usr/local/src
$ sudo curl -L "https://go.dev/dl/go1.17.5.linux-amd64.tar.gz" -O
$ cd ..
$ sudo unlink go # 以前の Go が入っている場合
$ sudo tar xvf src/go1.17.5.linux-amd64.tar.gz
$ sudo mv go go1.17.5
$ sudo ln -s go1.17.5 go
$ go version # /usr/local/go/bin にパスが通っている場合
go version go1.17.5 linux/amd64
アップデートは計画的に。
参考図書
- プログラミング言語Go (ADDISON-WESLEY PROFESSIONAL COMPUTING SERIES)
- Alan A.A. Donovan (著), Brian W. Kernighan (著), 柴田 芳樹 (翻訳)
- 丸善出版 2016-06-20
- 単行本(ソフトカバー)
- 4621300253 (ASIN), 9784621300251 (EAN), 4621300253 (ISBN)
- 評価
著者のひとりは(あの「バイブル」とも呼ばれる)通称 “K&R” の K のほうである。この本は Go 言語の教科書と言ってもいいだろう。と思ったら絶版状態らしい(2025-01 現在)。復刊を望む!