Rust advisories / metrics-util
Vulnerability MediumRUSTSEC-2021-0113 · metrics-util
RUSTSEC-2021-0113: AtomicBucket<T> unconditionally implements Send/Sync
Short answerA security vulnerability in the metrics-util crate: AtomicBucket<T> unconditionally implements Send/Sync. GitHub rates it Medium. Fixed in 0.7.0: update to a fixed version.
| Crate | metrics-util |
|---|---|
| Type | Vulnerability (memory-corruption, thread-safety) |
| Affected versions | Before 0.7.0. |
| Fixed in | 0.7.0 |
| Severity | Medium (GitHub rating) |
| Published | 2021-04-07 |
| Last changed | 2023-11-08 |
| Also known as | CVE-2021-45704, GHSA-3hxh-7jxm-59x4, GHSA-cwvc-87xq-pc5m |
What to do
- See which version you have:
cargo tree -i metrics-util(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p metrics-util. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplemetrics-util = "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
In the affected versions of the crate, AtomicBucket<T> unconditionally implements Send/Sync traits. Therefore, users can create a data race to the inner T: !Sync by using the AtomicBucket::data_with() API. Such data races can potentially cause memory corruption or other undefined behavior.
The flaw was fixed in commit 8e6daab by adding appropriate Send/Sync bounds to the Send/Sync impl of struct Block<T> (which is a data type contained inside AtomicBucket<T>).
References
- Package: crates.io/crates/metrics-util
- Advisory: rustsec.org/advisories/RUSTSEC-2021-0113.html
- Report: github.com/metrics-rs/metrics/issues/190
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
Same cratemetrics-util: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?