Apache Commons Codec Blake3 doFinalize is stateless (CVE-2026-119078)
Repeated doFinalize calls without new input return the same bytes, so the documented KDF example derives identical keys.
Identical Blake3 keys from repeated doFinalize in Commons Codec
Apache Commons Codec's Blake3.doFinalize does not change hash state, so a second call without more input returns the same bytes. The class Javadoc key-derivation example, shipped since 1.16.0, uses two consecutive calls and therefore derives identical keys. Any application that follows that example, or otherwise calls doFinalize more than once on one instance expecting new output, loses key separation. This affects Commons Codec from 1.16.0 before 1.23.0.
What to do: Upgrading to 1.23.0 alone does not fix affected code. Find repeated doFinalize calls on one Blake3 instance and derive multiple keys by requesting the combined length in one call, then splitting, as the updated Javadoc shows.
| Product | Affected | Fixed in |
|---|---|---|
| Apache Commons Codec | 1.16.0 before 1.23.0 | 1.23.0 (documentation only; doFinalize behavior unchanged) |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
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.
Repeated doFinalize calls without new input return the same bytes, so the documented KDF example derives identical keys.
Today 1.5K readers · 2.4K views · 768 reads · all time 189K views