-
CVSS Score
-The vulnerability exists in the reciprocal_mg10 function within the ruint crate. The core of the issue is the use of debug_assert! for a critical safety check. In Rust, debug_assert! macros are only enabled in debug builds and are completely removed in release/optimized builds to improve performance. The patch replaces debug_assert!(d >= (1 << 63)); with assert!(d >= (1 << 63));. The assert! macro remains in release builds, thus enforcing the necessary precondition on the input d and preventing the out-of-bounds access. The vulnerable function is reciprocal_mg10 because it contains this flawed check. During exploitation in a release build, a call to this function with an invalid d would trigger the vulnerability.
reciprocal_mg10src/algorithms/div/reciprocal.rs
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| ruint | rust | <= 1.17.0 |