CVE-2026-137940

Pillow through 13.1.0 Crash via ImageMath INT32_MIN Division by -1

Published Nov 27, 2026 CVSS 4.0 · 5.7 Medium EPSS n/a KEV · Not listed
Description
Pillow through 13.1.0 contains an integer overflow in the ImageMath integer divide and modulo operators (DIV_I and MOD_I in src/_imagingmath.c), which guard only against a zero divisor, so dividing INT32_MIN by -1 raises a hardware divide exception. Attackers can supply a crafted TIFF that decodes to a mode I image containing INT32_MIN, crashing applications that run an ImageMath divide or modulo with a -1 operand on it.

Analysis

AI-generated

Technical impact

Pillow through version 13.1.0 contains an integer overflow in the image math division and modulo operators that ignore a negative divisor. When an ImageMath division or modulo is performed with a numerator of INT32_MIN and a divisor of –1, a hardware divide exception occurs. This causes the process using Pillow to crash, resulting in a denial‑of‑service condition for that application.

Affected Systems

The vulnerability affects the Python Pillow image processing library for all releases up to and including version 13.1.0. Any software that depends on Pillow and processes user supplied TIFF images may be impacted.

Risk and Exploitability

The CVSS score is 5.7, indicating moderate severity. EPSS data is not available, and the vulnerability is not listed in CISA’s KEV catalog. Attackers can supply a crafted TIFF image that includes a mode‑I image containing the value INT32_MIN. When the target application performs an ImageMath division or modulo operation on that image, it will trigger a crash. The most likely attack vector is through user‑supplied image input, either locally or remotely where the application processes content from untrusted sources.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Pillow library to version 13.1.1 or later to apply the vendor fix.
  • If an upgrade is not immediately possible, isolate the image‑processing workload in a sandboxed environment so that a crash cannot take down the entire system.
  • Validate or sanitize incoming TIFF images to reject mode‑I images containing the value INT32_MIN before performing ImageMath operations, thereby preventing the integer overflow from occurring.

Generated by OpenCVE AI on November 27, 2026 at 14:37 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Python-pillow
Python-pillow pillow
Vendors & Products Python-pillow
Python-pillow pillow
Type Values Removed Values Added
Description Pillow through 13.1.0 contains an integer overflow in the ImageMath integer divide and modulo operators (DIV_I and MOD_I in src/_imagingmath.c), which guard only against a zero divisor, so dividing INT32_MIN by -1 raises a hardware divide exception. Attackers can supply a crafted TIFF that decodes to a mode I image containing INT32_MIN, crashing applications that run an ImageMath divide or modulo with a -1 operand on it.
Title Pillow through 13.1.0 Crash via ImageMath INT32_MIN Division by -1
Weaknesses CWE-190
References
Metrics cvssV3_1

{'score': 4.7, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H'}

cvssV4_0

{'score': 5.7, 'vector': 'CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-190

    Integer Overflow or Wraparound

Sources

Status
PUBLISHED
Assigner
AISLE
Published
Updated
Nov 27, 2026, 1:43 PM
Reserved
Nov 27, 2026, 1:36 PM
Status
Awaiting Analysis
Published
Nov 27, 2026, 2:17 PM
Modified
Nov 27, 2026, 2:17 PM