Integer Overflow Affecting chacha20 package, versions <0.2.3


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.14% (51st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-RUST-CHACHA20-1244076
  • published8 Apr 2021
  • disclosed22 Oct 2019
  • creditUnknown

Introduced: 22 Oct 2019

CVE-2019-25005  (opens in a new tab)
CWE-680  (opens in a new tab)

How to fix?

Upgrade chacha20 to version 0.2.3 or higher.

Overview

chacha20 is a stream cipher algorithm written in pure Rust.

Affected versions of this package are vulnerable to Integer Overflow. The ChaCha20 stream cipher can produce a maximum of 2^32 blocks (~256GB) before the 32-bit counter overflows. The crate allows generating key-streams larger than this, including seeking past the limit. When this occurs, the key-stream is duplicated, with failure modes similar to nonce reuse.

Note 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).

CVSS Scores

version 3.1