CVE-2025-57808: Strncmp Offset Length Auth Bypass

When comparing an expected token or digest against user-provided input using `strncmp()`, dynamically calculating the comparison length using an input string size minus an offset (e.g., `input.size() - offset`) creates an authentication bypass vulnerability. An attacker can provide a shorter input or empty credentials that match a prefix of the expected toke

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0C++
greprules fetch cve-2025-57808-strncmp-offset-length-auth-bypass --engine opengrep

Description

When comparing an expected token or digest against user-provided input using `strncmp()`, dynamically calculating the comparison length using an input string size minus an offset (e.g., `input.size() - offset`) creates an authentication bypass vulnerability. An attacker can provide a shorter input or empty credentials that match a prefix of the expected toke