概要
Blake3 の doFinalize を続けて呼ぶと同じ値が返り、鍵が分離されないおそれ。
元の説明(英語)を読む
Apache Commons Codec's Blake3 class documented the output of its doFinalize methods as depending on any previously finalized bytes, so that consecutive calls would return different output. In fact, doFinalize does not change the hash state: calling it again without supplying more input returns the same bytes. The key-derivation example in the class Javadoc, shipped since 1.16.0, derives two keys with two consecutive doFinalize calls. Code that follows it gets identical keys, so the separation between the derived keys is lost. The same applies to any application that calls doFinalize more than once on one instance and expects new output each time. This issue affects Apache Commons Codec from 1.16.0 before 1.23.0. Version 1.23.0 corrects the documentation, but the behavior of doFinalize is unchanged. Upgrading alone does not fix affected code. Users should check their applications for repeated doFinalize calls on the same Blake3 instance and derive multiple keys by requesting the combined length in one call and splitting the output, as the updated Javadoc shows.
影響を受ける人
Commons Codec 1.16.0 以降 1.23.0 前で Blake3 を使う開発者
対策
- Apache Commons Codec を 1.23.0 以降に更新する(直るのは説明文のみ)。
- doFinalize の繰り返し呼び出しを確認し、必要な長さを1回で出力して分割する。
国内の動き
本文に同じ CVE 番号のある国内の注意喚起・報道は、まだ無い。
海外の動き
本文に同じ CVE 番号のある海外の注意喚起・報道は、まだ無い。
PoC
公開されている PoC は、まだ見つかっていない。