GitHub Advisoryadvisory · crates.io

GHSA-9fjq-45qv-pcm7 ruint affected by unsoundness of safe `reciprocal_mg10`

MEDIUM Published 2025-12-26 Modified 2025-12-26 Official page ↗
Ecosystem
crates.io
Packages
ruint
Severity
Moderate
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:U
Weaknesses
CWE-119
Reviewed
2025-12-26

Affected packages

• crates.io ruint: <= 1.17.0 (no fix yet)

Description

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.

Related

Weakness · CWE (1)

  • CWE-119 Improper Restriction of Operations within the Bounds of a Memory Buffer weakness

References