rapidhash is vulnerable to Use of Insufficiently Random Values
40
Medium Risk
rapidhash's RandomState derives each hasher's seed from a thread-local counter that starts at zero combined with the current stack address as its only per-thread entropy. When the operating system recycles thread stacks, newly spawned threads observe the same stack address and therefore compute duplicate, predictable seeds, and on targets without ASLR or ambient entropy the seed is effectively deterministic. An attacker who can predict the seed can craft keys that all collide in a HashMap or HashSet, forcing worst-case quadratic behavior and denial of service. The fix initializes each thread's seed counter from a global thread counter mixed with a process-wide random seed and adds getrandom-based entropy paths for no_std and wasm targets.
You are affected if you are using a version that falls within the vulnerable range and rely on RandomState or RapidHashMap/RapidHashSet for HashDoS resistance when hashing untrusted or externally supplied keys.
rapidhash is vulnerable to Use of Insufficiently Random Values in versions 2.0.0 - 4.4.2.
Upgrade the rapidhash library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant