Go 1.13.2 および Go 1.13.3 のリリース【セキュリティ・アップデート】
Go 1.13.2 がリリースされた。
今回のはちょーっとヤバめかも。
HTTPS サーバを構成している場合は要注意。
Invalid DSA public keys can cause a panic in.dsa.Verify
. In particular, usingcrypto/x509.Verify
on acrafted X.509
certificate chain can lead to a panic, even if the certificates don’t chain to a trusted root. The chain can be delivered via acrypto/tls
connection to a client, or to a server that accepts and verifies client certificates.net/http
clients can be made to crash by an HTTPS server, while net/http servers that accept client certificates will recover the panic and are unaffected
他にも OpenPGP, OTR, SSH あたりも影響を受けるそうな。
Moreover, an application might crash invoking.crypto/x509.(*CertificateRequest).CheckSignature
on an X.509 certificate request, parsing a golang.org/x/crypto/openpgp Entity, or during a golang.org/x/crypto/otr conversation. Finally, a golang.org/x/crypto/ssh client can panic due to a malformed host key, while a server could panic if eitherPublicKeyCallback
accepts a malformed public key, or ifIsUserAuthority
accepts a certificate with a malformed public key
更に更に slice に関して
The Go 1.13.2 release also includes a fix to the compiler that prevents improper access to negative slice indexes in rare cases. Affected code, in which the compiler can prove that the index is zero or negative, would have resulted in a panic in Go 1.12, but could have led to arbitrary memory read and writes in Go 1.13 and Go 1.13.1.
とあり, Go 1.13.x でバイナリを提供している場合はもれなくリコンパイルする必要があるかもねぇ。
【追記】 Go 1.13.3 のリリース
まさか5時間足らずでアップデートするとは思わざりき。 別途記事を起こすのはアレなので,この記事に追記する。 フットワークの軽い言語だとポジティブに考えることにしよう(笑)
というわけで Go 1.13.3 がリリースされた。
go1.13.3 (released 2019/10/17) includes fixes to the go command, the toolchain, the.runtime
,syscall
,net
,net/http
, andcrypto/ecdsa
packages. See the Go 1.13.3 milestone on our issue tracker for details
1.13.2 のアップデートがまだの人はまとめてやってしまおう。 私のように既にアップデートしてしまった人は,ごくろーさん(泣)
Ubuntu の APT は相変わらずサポートから外れた 1.10.x しか対応していないのでダウンロードページからバイナリ(go1.13.3.linux-amd64.tar.gz
)を取ってきて手動でインストールすることを強く推奨する。
$ cd /usr/local/src
$ sudo curl "https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz" -O
$ cd ..
$ sudo unlink go # 以前の Go が入っている場合
$ sudo tar xvf src/go1.13.3.linux-amd64.tar.gz
$ sudo mv go go1.13.3
$ sudo ln -s go1.13.3 go
$ go version # /usr/local/go/bin にパスが通っている場合
go version go1.13.3 linux/amd64
アップデートは計画的に。
ブックマーク
- crypto/dsa: invalid public key causes panic in dsa.Verify · Issue #34960 · golang/go · GitHub
- cmd/compile: access to negative slice indices improperly permitted · Issue #34802 · golang/go · GitHub
参考図書
- プログラミング言語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 現在)。復刊を望む!