ruint is vulnerable to Denial of Service (DoS)
62
Medium Risk
Uint::overflowing_shl and overflowing_shr in the ruint crate returned false-negative overflow flags. Left shifts missed bits shifted above BITS but still inside the top limb (non-limb-aligned widths such as U160) and limbs wholly discarded by shifts of 64 or more; right shifts missed wholly discarded low limbs. The shifted value itself was correct, but the wrong flag propagates to checked_*, strict_*, and saturating_* shift helpers. On no-alloc builds, the incorrect checked_shl result causes to_base_be (and string formatting) to loop forever for non-limb-aligned widths, enabling denial of service when formatting is reachable from untrusted input. Separately, wrapping_shl/wrapping_shr on 64/128/256-bit types truncated the shift amount modulo 2^32, so shifts of 2^32 or more returned an incorrectly wrapped value instead of zero.
You are affected if you are using a version that falls within the vulnerable range and your application uses Uint shift helpers (overflowing_*, checked_*, saturating_*, or wrapping_*) with untrusted shift amounts, or formats Uint values on no-alloc builds where that path is reachable from untrusted input.
ruint is vulnerable to Denial of Service (DoS) in versions 0.1.0 - 1.19.0.
Upgrade the ruint 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