CVE-2026-137940: Pillow through 13.1.0 Crash via ImageMath INT32_MIN Division by -1
Pillow through 13.1.0 contains an integer overflow in the ImageMath integer divide and modulo operators (DIVI and MODI in src/imagingmath.c), which guard only against a zero divisor, so dividing INT32MIN by -1 raises a hardware divide exception. Attackers can supply a crafted TIFF that decodes to a mode I image containing INT32MIN, crashing applications that run an ImageMath divide or modulo with a -1 operand on it.
Affected Software
Event History
Frequently Asked Questions
What conditions are required to trigger the crash?
An attacker must provide a crafted TIFF that decodes to a mode I image containing the INT32_MIN value. The application must then use Pillow ImageMath division or modulo with -1 as the other operand.
Are applications that only process ordinary image inputs affected?
The issue specifically requires a TIFF crafted to decode as a mode I image with INT32_MIN. It also requires an ImageMath DIV_I or MOD_I operation using -1, so processing the image alone is not sufficient based on the available information.
What is the impact of successful exploitation?
Successful triggering raises a hardware divide exception and crashes the affected application. The provided severity vector indicates availability impact only, with no stated confidentiality or integrity impact.