CVE-2024-21491: Rust Zip Fold Length Bypass

A comparison using `zip` and `fold` was detected without a preceding length equivalence check. The `Iterator::zip` method stops when the shortest iterator is exhausted. If an attacker provides a partial input shorter than the expected input but matching its prefix, `zip` will successfully evaluate to true, causing an authentication or comparison bypass. Expl

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Rustβ
greprules fetch cve-2024-21491-rust-zip-fold-length-bypass --engine opengrep

Description

A comparison using `zip` and `fold` was detected without a preceding length equivalence check. The `Iterator::zip` method stops when the shortest iterator is exhausted. If an attacker provides a partial input shorter than the expected input but matching its prefix, `zip` will successfully evaluate to true, causing an authentication or comparison bypass. Expl