# RUSTSEC-2024-0400: ruzstd uninit and out-of-bounds memory reads

- Database: RustSec
- Published: 2024-11-28
- Modified: 2025-10-28

## Also published as

- [GHSA-X3F4-45XF-RJM7](https://cve.now/GHSA-X3F4-45XF-RJM7.md) (GitHub)

## Affected versions

- ruzstd (crates.io): from 0.7.0, fixed in 0.7.3

## Description

Affected versions of `ruzstd` miscalculate the length of the allocated
and init section of its internal `RingBuffer`, leading to uninitialized
or out-of-bounds reads in `copy_bytes_overshooting` of up to 15 bytes.

This may result in up to 15 bytes of memory contents being written
into the decoded data when decompressing a crafted archive.
This may occur multiple times per archive.

## References

- https://crates.io/crates/ruzstd
- https://rustsec.org/advisories/RUSTSEC-2024-0400.html
- https://github.com/KillingSpark/zstd-rs/issues/75
- https://github.com/KillingSpark/zstd-rs/pull/76

Page: https://cve.now/RUSTSEC-2024-0400

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
