Email me

Rust advisories / chacha20

Vulnerability HighRUSTSEC-2019-0029 · chacha20

RUSTSEC-2019-0029: ChaCha20 counter overflow can expose repetitions in the keystream

Short answerA security vulnerability in the chacha20 crate: ChaCha20 counter overflow can expose repetitions in the keystream. High severity (CVSS 7.5). Fixed in 0.2.3: update to a fixed version.

Cratechacha20
TypeVulnerability (crypto-failure)
Affected versionsBefore 0.2.3.
Fixed in0.2.3
SeverityHigh, CVSS 7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Published2019-10-22
Last changed2023-11-08
Also known asCVE-2019-25005, GHSA-j2r6-2m5c-vgh5

What to do

  1. See which version you have: cargo tree -i chacha20 (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p chacha20. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example chacha20 = "0.2.3") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

The ChaCha20 stream cipher can produce a maximum of 2^32 blocks (~256GB) before the 32-bit counter overflows. Releases of the chacha20 crate prior to v0.2.3 allow generating keystreams larger than this, including seeking past the limit. When this occurs, the keystream is duplicated, with failure modes similar to nonce reuse (i.e. exposure of the XOR of two plaintexts).

The v0.2.3 release now panics in this event, rather than exposing the duplicated keystream. Note this is a "hot fix" solution to the problem and future releases will pursue returning an error in this case.

Users of the chacha20poly1305 crate are unaffected by this as this crate properly asserts the length of the plaintext is less than the maximum allowed (P_MAX as described in RFC 8439 Section 2.8).

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Up next

Same cratechacha20: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ