Go 1.19.4 のリリース【セキュリティ・アップデート】
予告通り 2022-12-07 (日本時間) に Go 1.19.4 がリリースされた。
今回は2件の脆弱性修正を含んでいる。
CVE-2022-41720 os, net/http: avoid escapes from os.DirFS and http.Dir on Windows
The
os.DirFS
function andhttp.Dir
type provide access to a tree of files rooted at a given directory. These functions permitted access to Windows device files under that root. For example,os.DirFS("C:/tmp").Open("COM1")
would open theCOM1
device. Bothos.DirFS
andhttp.Dir
only provide read-only filesystem access.In addition, on Windows, an
os.DirFS
for the directory\
(the root of the current drive) can permit a maliciously crafted path to escape from the drive and access any path on the system.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- 深刻度: 重要 (Score: 7.5)
基本評価基準 | 評価値 |
---|---|
攻撃元区分 | ネットワーク |
攻撃条件の複雑さ | 低 |
必要な特権レベル | 不要 |
ユーザ関与レベル | 不要 |
スコープ | 変更なし |
機密性への影響 | 高 |
完全性への影響 | なし |
可用性への影響 | なし |
CVE-2022-41717 net/http: limit canonical header cache by bytes, not entries
An attacker can cause excessive memory growth in a Go server accepting HTTP/2 requests.
HTTP/2 server connections contain a cache of HTTP header keys sent by the client. While the total number of entries in this cache is capped, an attacker sending very large keys can cause the server to allocate approximately 64 MiB per open connection.
This issue is also fixed in
golang.org/x/net/http2
vX.Y.Z
, for users manually configuring HTTP/2.The
os.DirFS
function andhttp.Dir
type provide access to a tree of files rooted at a given directory. These functions permitted access to Windows device files under that root. For example,os.DirFS("C:/tmp").Open("COM1")
would open theCOM1
device. Bothos.DirFS
andhttp.Dir
only provide read-only filesystem access.In addition, on Windows, an
os.DirFS
for the directory\
(the root of the current drive) can permit a maliciously crafted path to escape from the drive and access any path on the system.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- 深刻度: 警告 (Score: 5.3)
基本評価基準 | 評価値 |
---|---|
攻撃元区分 | ネットワーク |
攻撃条件の複雑さ | 低 |
必要な特権レベル | 不要 |
ユーザ関与レベル | 不要 |
スコープ | 変更なし |
機密性への影響 | なし |
完全性への影響 | なし |
可用性への影響 | 低 |
例によって…
Ubuntu の APT で管理している Go コンパイラは古いので,ダウンロードページからバイナリ(go1.19.4.linux-amd64.tar.gz
)を取ってきてインストールすることを推奨する。
以下は完全手動での作業例。
$ cd /usr/local/src
$ sudo curl -L "https://go.dev/dl/go1.19.4.linux-amd64.tar.gz" -O
$ cd ..
$ sudo unlink go # 以前の Go が入っている場合
$ sudo tar xvf src/go1.19.4.linux-amd64.tar.gz
$ sudo mv go go1.19.4
$ sudo ln -s go1.19.4 go
$ go version # /usr/local/go/bin にパスが通っている場合
go version go1.19.4 linux/amd64
Windows はインストールパッケージを取ってきて直接インストールする。 Scoop 経由でも OK
アップデートは計画的に。
参考図書
- プログラミング言語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 現在)。復刊を望む!
- 初めてのGo言語 ―他言語プログラマーのためのイディオマティックGo実践ガイド
- Jon Bodner (著), 武舎 広幸 (翻訳)
- オライリージャパン 2022-09-26
- 単行本(ソフトカバー)
- 4814400047 (ASIN), 9784814400041 (EAN), 4814400047 (ISBN)
- 評価
2021年に出た “Learning Go” の邦訳版。私は版元で PDF 版を購入。 Go 特有の語法(idiom)を切り口として Go の機能やパッケージを解説している。 Go 1.19 対応。