Rust advisories / mz-avro
Unsound MediumRUSTSEC-2021-0138 · mz-avro
RUSTSEC-2021-0138: Incorrect use of `set_len` allows for un-initialized memory
Short answermz-avro has an API that can cause undefined behaviour from safe code: Incorrect use of `set_len` allows for un-initialized memory. Fixed in 0.7.0.
| Crate | mz-avro |
|---|---|
| Type | Unsound (memory-exposure) |
| Affected versions | Before 0.7.0. |
| Fixed in | 0.7.0 |
| Severity | Medium (GitHub rating) |
| Published | 2021-10-14 |
| Last changed | 2023-11-08 |
| Also known as | GHSA-jwh2-vrr9-vcp2 |
What to do
- See which version you have:
cargo tree -i mz-avro(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p mz-avro. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplemz-avro = "0.7.0") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
Affected versions of this crate passes an uninitialized buffer to a user-provided Read implementation.
Arbitrary Read implementations can read from the uninitialized buffer (memory exposure) and also can return incorrect number of bytes written to the buffer. Reading from uninitialized memory produces undefined values that can quickly invoke undefined behavior.
Note: there is only UB in the case where a user provides a struct whose Read implementation inspects the buffer passed to read_exact before writing to it. This is an unidiomatic (albeit possible) Read implementation.
See https://github.com/MaterializeInc/materialize/issues/8669 for details.
References
- Package: crates.io/crates/mz-avro
- Advisory: rustsec.org/advisories/RUSTSEC-2021-0138.html
- Report: github.com/MaterializeInc/materialize/issues/8669
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Up next
Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →Also worth your time
Did this answer your question?