OpenJDK のセキュリティ・アップデート(2022-04)
定例の Java マイナー・バージョンアップが行われた。
CVE ID ベースで16個の脆弱性修正がある。 影響を受けるバージョンは 18, 17.0.2, 15.0.6, 13.0.10, 11.0.14, 8u322, 7u331 およびそれ以前。
CVE ID Component CVSSv3.1
ScoreAffects ... 7 8 11 13 15 17 18 CVE-2022-21476 security-libs/java.security
7.5 CVE-2022-21449 security-libs/java.security
7.5 CVE-2022-21496 core-libs/javax.naming
5.3 CVE-2022-21434 core-libs/java.lang
5.3 CVE-2022-21426 xml/jaxp
5.3 CVE-2022-21443 security-libs/java.security
3.7
このうち,2番目の CVE-2022-21449 は ECDSA に関するヤバいやつで Bruce Schneier 先生もこの脆弱性について言及されている。 元ネタの記事によると
The vulnerability, which Oracle patched on Tuesday, affects the company’s implementation of the Elliptic Curve Digital Signature Algorithm in Java versions 15 and above. ECDSA is an algorithm that uses the principles of elliptic curve cryptography to authenticate messages digitally. A key advantage of ECDSA is the smaller size of the keys it generates, compared to RSA or other crypto algorithms, making it ideal for use in standards including FIDO-based 2FA, the Security Assertion Markup Language, OpenID, and JSON.
だそうな。 もう少し詳細を抜き出すと
ECDSA signatures rely on a pseudo-random number, typically notated as K, that’s used to derive two additional numbers, R and S. To verify a signature as valid, a party must check the equation involving R and S, the signer’s public key, and a cryptographic hash of the message. When both sides of the equation are equal, the signature is valid.
For the process to work correctly, neither R nor S can ever be a zero. That’s because one side of the equation is R, and the other is multiplied by R and a value from S. If the values are both 0, the verification check translates to 0 = 0 X (other values from the private key and hash), which will be true regardless of the additional values. That means an adversary only needs to submit a blank signature to pass the verification check successfully.
Guess which check Java forgot?
That’s right. Java’s implementation of ECDSA signature verification didn’t check if R or S were zero, so you could produce a signature value in which they are both 0 (appropriately encoded) and Java would accept it as a valid signature for any message and for any public key. The digital equivalent of a blank ID card.
いやいやいや。 なんだその間抜けなバグ。
OpenJDK を APT で管理するメリットはないので,実行バイナリをリリースページから直接ダウンロードして配置する。 以下は完全手動でのインストール(笑)
$ cd /usr/local/src
$ sudo curl -L "https://download.java.net/java/GA/jdk18.0.1/3f48cabb83014f9fab465e280ccf630b/10/GPL/openjdk-18.0.1_linux-x64_bin.tar.gz" -O
$ cd ..
$ sudo unlink java # 以前のバージョンの Java 環境がある場合
$ sudo tar xvf src/openjdk-18.0.1_linux-x64_bin.tar.gz
$ sudo ln -s jdk-18.0.1 java
$ java -version # すでに PATH が通っている場合
openjdk version "18.0.1" 2022-04-19
OpenJDK Runtime Environment (build 18.0.1+10-24)
OpenJDK 64-Bit Server VM (build 18.0.1+10-24, mixed mode, sharing)
LTS 版 Java バイナリが欲しいなら Adoptium で取得できる。
私としては PlantUML が動けばいいので,試しておく1。

よーし,うむうむ,よーし。
ブックマーク
- Oracle Critical Patch Update Advisory - April 2022
- Critical cryptographic Java security blunder patched – update now! – Naked Security
- 2022年4月Oracle製品のクリティカルパッチアップデートに関する注意喚起
- 「Java」に署名検証がフリーパスになってしまう危険な脆弱性 ~影響は計り知れず - 窓の杜
- Javaの暗号化機能に署名検証をバイパスできる重大な脆弱性、研究者がPoC公開 | TECH+
参考図書
- Spring Data JPAプログラミング入門
- 溝口賢司 (著)
- 秀和システム 2017-08-03 (Release 2018-04-23)
- Kindle版
- B07CKHR8C1 (ASIN)
- 評価
JPA のお勉強用に購入。紙のほうはプレミアが付いてるっぽいが Kindle で買えるよ。固定レイアウトだからブラウザの Kindle Cloud Reader で読めるし。真面目に基本を押さえて書いていて分かりやすい。
- Effective Java 第3版
- Joshua Bloch (著), 柴田 芳樹 (翻訳)
- 丸善出版 2018-10-30
- 単行本(ソフトカバー)
- 4621303252 (ASIN), 9784621303252 (EAN), 4621303252 (ISBN)
- 評価
再勉強中。 Kindle 版のほうがちょっと安いが,勤務先でも使いたかったので紙の本にした。
- Spring Boot 2 入門: 基礎から実演まで
- 原田 けいと (著), 竹田 甘地 (著), Robert Segawa (著)
- 2020-05-22 (Release 2020-05-22)
- Kindle版
- B0893LQ5KY (ASIN)
- 評価
Spring Boot を勉強することになって急遽買った本。めっさ分かりやすかった。 PDF 版が欲しいくらい(笑) Spring Boot 3.2 対応にアップデートされていた。素敵!
-
2021-04-09 に PlantUML V1.2022.4 がリリースされている。 PlantUML の使い方等については拙文「真面目に PlantUML」シリーズを参考にどうぞ。 ↩︎