#golang Unicode パッケージの脆弱性

no extension

golang.org/x/text/encoding/unicode パッケージで脆弱性が見つかった模様。

Version v0.3.3 of golang.org/x/text fixes a vulnerability in the golang.org/x/text/encoding/unicode package which could lead to the UTF-16 decoder entering an infinite loop, causing the program to crash or run out of memory.

An attacker could provide a single byte to a UTF16 decoder instantiated with UseBOM or ExpectBOM to trigger an infinite loop if the String function on the Decoder is called, or the Decoder is passed to golang.org/x/text/transform.String.

というわけで,件のパッケージを使って UTF-16 符号化・復号化の操作を行っている場合は最新バージョンのパッケージに差し替えること。 とりあえず go.mod ファイルを見て

require golang.org/x/text v0.3.2

とか v0.3.3 未満になっている場合は

require golang.org/x/text latest

と最新版に書き換えてコンパイルし直せばいいだろう。

CVE-2020-14040

  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • 深刻度: 重要 (7.5)
基本評価基準 評価値
攻撃元区分 ネットワーク
攻撃条件の複雑さ
必要な特権レベル 不要
ユーザ関与レベル 不要
スコープ 変更なし
機密性への影響 なし
完全性への影響 なし
可用性への影響

参考図書

photo
プログラミング言語Go
アラン・ドノバン (著), ブライアン・カーニハン (著), 柴田芳樹 (著)
丸善出版 2016-06-20 (Release 2021-07-13)
Kindle版
B099928SJD (ASIN)
評価     

Kindle 版出た! 一部内容が古びてしまったが,この本は Go 言語の教科書と言ってもいいだろう。感想はこちら

reviewed by Spiegel on 2021-05-22 (powered by PA-APIv5)