This project might be open to known security vulnerabilities, which can be prevented by tightening the version range of affected dependencies. Find detailed information at the bottom.

Crate alloy-primitives

Dependencies

(26 total, 8 outdated, 3 possibly insecure)

CrateRequiredLatestStatus
 allocative^0.3.20.3.4up to date
 alloy-rlp^0.30.3.15up to date
 arbitrary^1.31.4.2up to date
 bytes ⚠️^11.11.1maybe insecure
 cfg-if^1.0.01.0.4up to date
 derive_arbitrary^1.31.4.2up to date
 derive_more^1.02.1.1out of date
 foldhash^0.10.2.0out of date
 getrandom^0.20.4.2out of date
 hashbrown ⚠️^0.150.16.1out of date
 const-hex^1.141.18.1up to date
 hex-literal^0.41.1.0out of date
 indexmap^2.52.13.1up to date
 itoa^11.0.18up to date
 k256^0.130.13.4up to date
 keccak-asm^0.1.00.1.6up to date
 paste^1.01.0.15up to date
 postgres-types^0.2.60.2.13up to date
 proptest^11.11.0up to date
 proptest-derive^0.50.8.0out of date
 rand^0.80.10.0out of date
 ruint ⚠️^1.12.31.17.2maybe insecure
 rustc-hash^2.02.1.2up to date
 serde^1.01.0.228up to date
 sha3^0.10.80.11.0out of date
 tiny-keccak^2.02.0.2up to date

Dev dependencies

(4 total, 3 outdated)

CrateRequiredLatestStatus
 bcs^0.1.60.2.0out of date
 bincode^1.33.0.0out of date
 criterion^0.50.8.2out of date
 serde_json^1.01.0.149up to date

Security Vulnerabilities

hashbrown: Borsh serialization of HashMap is non-canonical

RUSTSEC-2024-0402

The borsh serialization of the HashMap did not follow the borsh specification. It potentially produced non-canonical encodings dependent on insertion order. It also did not perform canonicty checks on decoding.

This can result in consensus splits and cause equivalent objects to be considered distinct.

This was patched in 0.15.1.

ruint: Unsoundness of safe `reciprocal_mg10`

RUSTSEC-2025-0137

The function reciprocal_mg10 is marked as safe but can trigger undefined behavior (out-of-bounds access) because it relies on debug_assert! for safety checks instead of assert!.

When compiled in release mode, the debug_assert! is optimized out, potentially allowing invalid inputs to cause memory corruption.

bytes: Integer overflow in `BytesMut::reserve`

RUSTSEC-2026-0007

In the unique reclaim path of BytesMut::reserve, the condition

if v_capacity >= new_cap + offset

uses an unchecked addition. When new_cap + offset overflows usize in release builds, this condition may incorrectly pass, causing self.cap to be set to a value that exceeds the actual allocated capacity. Subsequent APIs such as spare_capacity_mut() then trust this corrupted cap value and may create out-of-bounds slices, leading to UB.

This behavior is observable in release builds (integer overflow wraps), whereas debug builds panic due to overflow checks.

PoC

use bytes::*;

fn main() {
    let mut a = BytesMut::from(&b"hello world"[..]);
    let mut b = a.split_off(5);

    // Ensure b becomes the unique owner of the backing storage
    drop(a);

    // Trigger overflow in new_cap + offset inside reserve
    b.reserve(usize::MAX - 6);

    // This call relies on the corrupted cap and may cause UB & HBO
    b.put_u8(b'h');
}

Workarounds

Users of BytesMut::reserve are only affected if integer overflow checks are configured to wrap. When integer overflow is configured to panic, this issue does not apply.