Intel

AIKIDO-2025-10187

alloy-primitives is vulnerable to Undefined Behavior

Undefined Behavior Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Mar 26, 2025

35

Low Risk

This Affects:

rustalloy-primitives
0.1.0 - 0.8.24
Fixed in 0.8.25
Are you affected? Scan for Free

TL;DR

Affected versions of this package generate random FixedBytes primitives incorrectly by calling assume_init on an uninitialized array, leading to immediate undefined behavior. Since an uninitialized byte array is always invalid in Rust, this violates safety rules. The fix ensures that every element is properly written to before calling assume_init, using MaybeUninit<u8>; N and leveraging getrandom for safe randomization. For rand, a manual implementation of the Fill trait via a wrapper is used.

Who does this affect?

You are affected if you are using a version which is within vulnerability ranges and using template::UriTemplateStr.

Background info

alloy-primitives is vulnerable to Undefined Behavior in versions 0.1.0 - 0.8.24.

How to fix this

Upgrade the alloy-primitives library to the patch version.