Critical Overflow Flag Issue in ruint Package: Uint Shift Operations Vulnerability
Summary
RUSTSEC-2026-0220: Uint shift operations: incorrect overflow flags and truncated shift amounts. Affects ruint versions >= 0.0.0-0, < 1.20.0. Fixed in 1.20.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The ruint package is a Rust library that provides arbitrary precision unsigned integer types. It is designed for applications requiring high-performance arithmetic operations on large integers. However, the package has a vulnerability related to its shift operations, which can lead to incorrect overflow flags and potential denial of service in certain scenarios.
Vulnerability Detail
The vulnerability arises from the incorrect handling of overflow flags in the shift operations of the Uint type. Specifically, the methods overflowing_shl and overflowing_shr fail to return accurate overflow flags when bits are shifted beyond the defined limits. This can lead to false positives in overflow checks, causing functions like checked_shl and checked_shr to return unexpected results. The incorrect flags can propagate through the code, leading to infinite loops in string formatting functions when untrusted input is processed, posing a significant denial of service risk. Additionally, the wrapping_shl and wrapping_shr methods truncate shift amounts incorrectly, which can result in erroneous calculations on certain architectures.
How To Fix
Latest published version: 1.21.0 as of 23 Oct 2026
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
1.20.0
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, avoid using the affected shift operations (checked_shl, checked_shr, overflowing_shl, overflowing_shr, saturating_shl, saturating_shr, wrapping_shl, and wrapping_shr) with untrusted shift amounts until the package is updated.
Conclusion
The ruint package has a critical vulnerability related to its shift operations, which can lead to incorrect overflow handling and denial of service risks. It is essential to update to version 1.20.0 or later to mitigate these risks. Users are encouraged to monitor their applications for vulnerabilities using tools like Vulert.
See every vulnerability recorded for ruint →
FAQ
The vulnerability involves incorrect overflow flag handling in shift operations, which can lead to erroneous results and potential denial of service.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.
The consequences include incorrect calculations, infinite loops in string formatting, and potential denial of service when processing untrusted input.
Yes, the vulnerability has been patched in version 1.20.0 of the ruint package. Updating to this version will resolve the issue.
If an immediate update is not possible, avoid using the affected shift operations with untrusted inputs as a temporary workaround.
References
Related vulnerabilities
Recent vulnerabilities recorded for ruint.