CVE-2021-45704
AtomicBucket<T> unconditionally implements Send/Sync
An issue was discovered in the metrics-util crate before 0.7.0 for Rust. There is a data race and memory corruption because AtomicBucket<T> unconditionally implements the Send and Sync traits.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
8.1
An issue was discovered in the metrics-util crate before 0.7.0 for Rust. There is a data race and memory corruption because AtomicBucket<T> unconditionally implements the Send and Sync traits.
- Record
CVE-2021-45704- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 6.8 Medium
AV:N/AC:M/Au:N/C:P/I:P/A:P - Weakness
- CWE-362, CWE-787
- Updated
- 2026-11-02
CVE List No score
An issue was discovered in the metrics-util crate before 0.7.0 for Rust. There is a data race and memory corruption because AtomicBucket<T> unconditionally implements the Send and Sync traits.
- Record
CVE-2021-45704- Updated
- 2026-11-02
EUVDEUVD-2022-0570 No score
An issue was discovered in the metrics-util crate before 0.7.0 for Rust. There is a data race and memory corruption because AtomicBucket<T> unconditionally implements the Send and Sync traits.
- Record
EUVD-2022-0570- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-cwvc-87xq-pc5m
8.1
Out-of-bounds Write and Race Condition in metrics-util
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>).
- Record
GHSA-cwvc-87xq-pc5m- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-362, CWE-787
- Updated
- 2026-11-02
GitHub AdvisoriesGHSA-3hxh-7jxm-59x4 No score
AtomicBucket<T> unconditionally implements Send/Sync
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>).
- Record
GHSA-3hxh-7jxm-59x4- Updated
- 2026-11-02
OSVGHSA-cwvc-87xq-pc5m
8.1
Out-of-bounds Write and Race Condition in metrics-util
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>).
- Record
GHSA-cwvc-87xq-pc5m- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-362, CWE-787
- Updated
- 2026-11-02
OSVGHSA-3hxh-7jxm-59x4 No score
AtomicBucket<T> unconditionally implements Send/Sync
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>).
- Record
GHSA-3hxh-7jxm-59x4- Updated
- 2026-11-02
OSVRUSTSEC-2021-0113 No score
AtomicBucket<T> unconditionally implements Send/Sync
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>).
- Record
RUSTSEC-2021-0113- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
metrics-utilcrates.io |
before 0.7.0 | 0.7.0 |
metrics-utilcrates.io |
0.0.0-0 up to 0.7.0 | 0.7.0 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-45704 is a high vulnerability (CVSS 8.1) in Metrics-util Project Metrics-util, published April 7, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.77%, the 55th percentile. Fixed in metrics-util 0.7.0.
References
rustsec.org/advisories/RUSTSEC-2021-0113.html
raw.githubusercontent.com/rustsec/advisory-db/main/crates/metrics-util/RUSTSEC-2021-0113.md
github.com/metrics-rs/metrics/issues/190
github.com/advisories/GHSA-3hxh-7jxm-59x4
nvd.nist.gov/vuln/detail/CVE-2021-45704
github.com/metrics-rs/metrics/commit/8e6daab
github.com/advisories/GHSA-cwvc-87xq-pc5m
github.com/metrics-rs/metrics
crates.io/crates/metrics-util