Go 1.20.4 のリリース【セキュリティ・アップデート】
今回は3件の脆弱性修正を含んでいる。
今回は html/template
の不具合ばっかりだな。
Web アプリケーションを組んでいる方は特に気をつけましょう。
CVE-2023-24539 html/template: improper sanitization of CSS values
Angle brackets (<>
) were not considered dangerous characters when inserted into CSS contexts. Templates containing multiple actions separated by a ‘/
’ character could result in unexpectedly closing the CSS context and allowing for injection of unexpected HMTL, if executed with untrusted input.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
- 深刻度: 重要 (Score: 7.3)
基本評価基準 | 評価値 |
---|---|
攻撃元区分 | ネットワーク |
攻撃条件の複雑さ | 低 |
必要な特権レベル | 不要 |
ユーザ関与レベル | 不要 |
スコープ | 変更なし |
機密性への影響 | 低 |
完全性への影響 | 低 |
可用性への影響 | 低 |
CVE-2023-24540 html/template: improper handling of JavaScript whitespace
Not all valid JavaScript whitespace characters were considered to be whitespace. Templates containing whitespace characters outside of the character set "\t\n\f\r\u0020\u2028\u2029"
in JavaScript contexts that also contain actions may not be properly sanitized during execution.
うわぁ,面倒くさい。
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- 深刻度: 緊急 (Score: 9.8)
基本評価基準 | 評価値 |
---|---|
攻撃元区分 | ネットワーク |
攻撃条件の複雑さ | 低 |
必要な特権レベル | 不要 |
ユーザ関与レベル | 不要 |
スコープ | 変更なし |
機密性への影響 | 高 |
完全性への影響 | 高 |
可用性への影響 | 高 |
CVE-2023-29400 html/template: improper handling of empty HTML attributes
Templates containing actions in unquoted HTML attributes (e.g. "attr={{.}}"
) executed with empty input could result in output that would have unexpected results when parsed due to HTML normalization rules. This may allow injection of arbitrary attributes into tags.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
- 深刻度: 重要 (Score: 7.3)
基本評価基準 | 評価値 |
---|---|
攻撃元区分 | ネットワーク |
攻撃条件の複雑さ | 低 |
必要な特権レベル | 不要 |
ユーザ関与レベル | 不要 |
スコープ | 変更なし |
機密性への影響 | 低 |
完全性への影響 | 低 |
可用性への影響 | 低 |
例によって…
Ubuntu の APT で管理している Go コンパイラは古いので,ダウンロードページからバイナリ(go1.20.4.linux-amd64.tar.gz
)を取ってきてインストールすることを推奨する。
以下は完全手動での作業例。
$ cd /usr/local/src
$ sudo curl -L "https://go.dev/dl/go1.20.4.linux-amd64.tar.gz" -O
$ cd ..
$ sudo unlink go # 以前の Go が入っている場合
$ sudo tar xvf src/go1.20.4.linux-amd64.tar.gz
$ sudo mv go go1.20.4
$ sudo ln -s go1.20.4 go
$ go version # /usr/local/go/bin にパスが通っている場合
go version go1.20.4 linux/amd64
Windows はインストールパッケージを取ってきて直接インストールする。 Scoop 経由でも OK
複数バージョンの Go コンパイラを扱いたい場合は
$ go install golang.org/dl/go1.20.4@latest
$ go1.20.4 download
$ go1.20.4 version
go version go1.20.4 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 現在)。復刊を望む!
- 初めてのGo言語 ―他言語プログラマーのためのイディオマティックGo実践ガイド
- Jon Bodner (著), 武舎 広幸 (翻訳)
- オライリージャパン 2022-09-26
- 単行本(ソフトカバー)
- 4814400047 (ASIN), 9784814400041 (EAN), 4814400047 (ISBN)
- 評価
2021年に出た “Learning Go” の邦訳版。私は版元で PDF 版を購入。 Go 特有の語法(idiom)を切り口として Go の機能やパッケージを解説している。 Go 1.19 対応。