RUSTSEC-2019-0029

    Dashboard / Vulnerabilities / RUSTSEC-2019-0029

    RUSTSEC-2019-0029

    Published: 22 Oct 2019Last Modified: 8 Nov 2023

    Summary: ChaCha20 counter overflow can expose repetitions in the keystream

    Details: 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).

    Affected packages

    Package

    Name: chacha20

    Purl: pkg:cargo/chacha20

    Affected ranges

    Type: SEMVER

    Events:

    Introduced- 0.0.0-0
    Fixed -0.2.3

    Affected versions

    Common Vulnerability Scoring System

    Attack Vector
    Network
    Adjacent
    Local
    Physical
    Privileges Required
    None
    Low
    High
    User Interaction
    None
    Required
    Scope
    Unchanged
    Changed
    Confidentiality
    None
    Low
    High
    Integrity
    None
    Low
    High
    Availability
    None
    Low
    High
    RUSTSEC-2019-0029 | CVE-DB