HistoryEditJSON (OSV)

RUSTSEC-2021-0131

Integer overflow in the bundled Brotli C library

Reported
Issued
Package
brotli-sys (crates.io)
Type
Vulnerability
Categories
Keywords
#integer-overflow
Aliases
References
Patched
no patched versions

Description

A buffer overflow exists in the Brotli library versions prior to 1.0.8 where an attacker controlling the input length of a "one-shot" decompression request to a script can trigger a crash, which happens when copying over chunks of data larger than 2 GiB.

An updated version of brotli-sys has not been released. If one cannot update the C library, its authors recommend to use the "streaming" API as opposed to the "one-shot" API, and impose chunk size limits.

In Rust the issue can be mitigated by migrating to the brotli crate, which provides a Rust implementation of Brotli compression and decompression that is not affected by this issue.

Advisory available under CC0-1.0 license.