Rust advisories / zeroize_derive
Vulnerability CriticalRUSTSEC-2021-0115 · zeroize_derive
RUSTSEC-2021-0115: `#[zeroize(drop)]` doesn't implement `Drop` for `enum`s
Short answerA security vulnerability in the zeroize_derive crate: `#[zeroize(drop)]` doesn't implement `Drop` for `enum`s. GitHub rates it Critical. Fixed in 1.1.1: update to a fixed version.
| Crate | zeroize_derive |
|---|---|
| Type | Vulnerability |
| Affected versions | Before 1.1.1. |
| Fixed in | 1.1.1 |
| Severity | Critical (GitHub rating) |
| Published | 2021-09-24 |
| Last changed | 2023-11-08 |
| Also known as | CVE-2021-45706, GHSA-c5hx-w945-j4pq |
What to do
- See which version you have:
cargo tree -i zeroize_derive(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p zeroize_derive. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplezeroize_derive = "1.1.1") 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 did not implement Drop when #[zeroize(drop)] was used on an enum.
This can result in memory not being zeroed out after dropping it, which is exactly what is intended when adding this attribute.
The flaw was corrected in version 1.2 and #[zeroize(drop)] on enums now properly implements Drop.
References
- Package: crates.io/crates/zeroize_derive
- Advisory: rustsec.org/advisories/RUSTSEC-2021-0115.html
- Report: github.com/iqlusioninc/crates/issues/876
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?