CVE-2023-52323: Non Constant Time Crypto Padding Parse

Using non-constant time methods like `.find()` or `.index()` to locate a padding separator byte (e.g., `b'\x01'` or `b'\x00'`) during decryption introduces a timing side-channel. This leaks information about the plaintext structure and makes the application vulnerable to padding oracle attacks like Manger's attack. Use constant-time array parsing instead.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Python
greprules fetch cve-2023-52323-non-constant-time-crypto-padding-parse --engine opengrep

Description

Using non-constant time methods like `.find()` or `.index()` to locate a padding separator byte (e.g., `b'\x01'` or `b'\x00'`) during decryption introduces a timing side-channel. This leaks information about the plaintext structure and makes the application vulnerable to padding oracle attacks like Manger's attack. Use constant-time array parsing instead.