CVE-2026-137940
Awaiting Analysis Awaiting Analysis - Queue

Integer Overflow in Pillow ImageMath Operators

Vulnerability report for CVE-2026-137940, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-11-27

Last updated on: 2026-11-27

Assigner: 1a4f025a-074d-4105-b4e2-52bd8eabe2ea

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-11-27
Last Modified
2026-11-27
Generated
2026-11-27
AI Q&A
2026-11-27
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
python-pillow Pillow From 0 (inc) to 13.1.0 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-190 The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

Pillow through 13.1.0 has an integer overflow in the ImageMath integer divide and modulo operators. It only checks for a zero divisor, so dividing INT32_MIN by -1 causes a hardware divide exception. Attackers can exploit this by providing a crafted TIFF file that decodes to a mode I image containing INT32_MIN, crashing applications that perform ImageMath division or modulo with a -1 operand.

Detection Guidance

This vulnerability can be detected by checking for applications using Pillow versions through 13.1.0. Inspect installed Pillow packages with commands like 'pip show Pillow' or 'pip list | grep Pillow'. Monitor for crashes in applications processing TIFF images, especially those involving ImageMath operations.

Impact Analysis

This vulnerability can crash applications using Pillow that process malicious TIFF files. It may lead to denial-of-service conditions if exploited, potentially disrupting services relying on image processing. Users should update Pillow to a patched version to avoid crashes.

Mitigation Strategies

Upgrade Pillow to the latest version beyond 13.1.0 immediately. If upgrading is not possible, restrict processing of untrusted TIFF files or disable ImageMath operations in affected applications. Apply patches or updates from the Pillow project as soon as they are available.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-137940. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart

Security Radar

News mentioning this vulnerability
Loading related security news...