NewsCrawler.org

CVE-2026-124851: Zstandard decoder can leak memory; mzstd is not affected

CVE-2026-124851: Zstandard decoder can leak memory; mzstd is not affected
Image: Reddit

CVE-2026-124851 is an information disclosure bug in the decoder of the C Zstandard library, versions 1.5.1 through 1.5.7. Crafted compressed data makes the streaming decoder copy bytes from a 64 KiB internal buffer into its output, which can expose uninitialized memory[1] or literals[2] from earlier decompressions on the same context. An attacker needs to send compressed data to a vulnerable decoder and be able to see the output. Zstandard 1.6.0, released on 23 November 2026, fixes the bug. Anyone who decodes untrusted data with the C library, including the system libzstd, language bindings and statically linked binaries, has to upgrade.

The leak combines two decoder behaviours. Literals are copied in 16-byte chunks, so stale bytes past the end of the literals can land in the output. When the streaming ring buffer[3] wraps around, an offset can point at memory that holds those bytes. zstd 1.6.0 trims the external dictionary to the window and zeroes the 32 bytes after each block's literals.

The authors built a 3,099-byte frame that leaks 15 bytes of a previous frame's literals in zstd 1.5.7. zstd 1.6.0 rejects it with Data corruption detected, and all 17 mzstd releases, 0.1.0 to 0.2.16, reject it with InvalidDataKind::Offset. mzstd is a separate Rust implementation of RFC 8878 that does not use the C library, forbids unsafe code, zero-fills its buffers and checks each offset against the frame's window. ngx_mzstd only compresses and is built without the decoder.

Read the original m-compressors.github.ioDiscussion

Sources

Published: First seen: Читать по-русски

Open as a page