CVE-2025-8194: Python Block Padding Missing Negative Check

A byte count is padded to a block size using `divmod` without validating if the count is negative. In Python, `divmod` with a negative dividend and positive divisor yields a negative quotient. This can result in negative padded lengths that propagate into file offsets or buffer sizes, potentially leading to backwards-seeking pointer errors, infinite loops, o

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0Python
greprules fetch cve-2025-8194-python-block-padding-missing-negative-check --engine opengrep

Description

A byte count is padded to a block size using `divmod` without validating if the count is negative. In Python, `divmod` with a negative dividend and positive divisor yields a negative quotient. This can result in negative padded lengths that propagate into file offsets or buffer sizes, potentially leading to backwards-seeking pointer errors, infinite loops, o