CVE-2026-25541: Rust Unchecked Bounds Addition

Unchecked addition in bounds or capacity check. If the addition wraps around due to integer overflow, the bounds check might incorrectly succeed. In Rust release mode, standard addition wraps. This can lead to incorrect state invariants, undersized buffer allocations, out-of-bounds writes, and Undefined Behavior. Use `.checked_add()` and handle the overflow

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Rust
greprules fetch cve-2026-25541-rust-unchecked-bounds-addition --engine opengrep

Description

Unchecked addition in bounds or capacity check. If the addition wraps around due to integer overflow, the bounds check might incorrectly succeed. In Rust release mode, standard addition wraps. This can lead to incorrect state invariants, undersized buffer allocations, out-of-bounds writes, and Undefined Behavior. Use `.checked_add()` and handle the overflow