RUSTSEC-2019-0029

Source
https://rustsec.org/advisories/RUSTSEC-2019-0029
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2019-0029.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2019-0029
Aliases
Published
2019-10-22T12:00:00Z
Modified
2023-11-08T04:01:32.169231Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N CVSS Calculator
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).

Database specific
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / chacha20

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0
Fixed
0.2.3

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "os": [],
        "functions": [],
        "arch": []
    }
}

Database specific

{
    "cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
    "informational": null,
    "categories": [
        "crypto-failure"
    ]
}