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.
(以下未稿)
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.
うわぁ,面倒くさい。
(以下未稿)
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.
(以下未稿)
例によって…
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
- アラン・ドノバン (著), ブライアン・カーニハン (著), 柴田芳樹 (著)
- 丸善出版 2016-06-20 (Release 2021-07-13)
- Kindle版
- B099928SJD (ASIN)
- 評価
Kindle 版出た! 一部内容が古びてしまったが,この本は Go 言語の教科書と言ってもいいだろう。感想はこちら。
- 初めてのGo言語 ―他言語プログラマーのためのイディオマティックGo実践ガイド
- Jon Bodner (著), 武舎 広幸 (翻訳)
- オライリージャパン 2022-09-26
- 単行本(ソフトカバー)
- 4814400047 (ASIN), 9784814400041 (EAN), 4814400047 (ISBN)
- 評価
2021年に出た “Learning Go” の邦訳版。私は版元で PDF 版を購入。 Go 特有の語法(idiom)を切り口として Go の機能やパッケージを解説している。 Go 1.19 対応。