CVE-2026-137940
Pillow through 13.1.0 Crash via ImageMath INT32_MIN Division by -1
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.
INFO
Published Date :
Nov. 27, 2026, 2:17 p.m.
Last Modified :
Nov. 27, 2026, 2:17 p.m.
Remotely Exploit :
No
Source :
1a4f025a-074d-4105-b4e2-52bd8eabe2ea
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS 3.1 | MEDIUM | MITRE-CVE | ||||
| CVSS 3.1 | MEDIUM | 1a4f025a-074d-4105-b4e2-52bd8eabe2ea | ||||
| CVSS 4.0 | MEDIUM | 1a4f025a-074d-4105-b4e2-52bd8eabe2ea |
Solution
- Update Pillow to a patched version.
- Avoid processing untrusted TIFF files.
- Sanitize integer division and modulo operations.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2026-137940.
| URL | Resource |
|---|---|
| https://github.com/python-pillow/Pillow | |
| https://github.com/python-pillow/Pillow/security/advisories/GHSA-rr9w-vmjp-9cg9 |
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2026-137940 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2026-137940
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2026-137940 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2026-137940 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
New CVE Received by 1a4f025a-074d-4105-b4e2-52bd8eabe2ea
Nov. 27, 2026
Action Type Old Value New Value 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. Added CVSS V4.0 AV:L/AC:H/AT:P/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X Added CVSS V3.1 AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H Added CWE CWE-190 Added Affected New affected value received. <a href="https://github.com/CVEProject/cvelistV5/blob/main/cves/2026/137xxx/CVE-2026-137940.json">CVE-2026-137940</a> Added Reference https://github.com/python-pillow/Pillow Added Reference https://github.com/python-pillow/Pillow/security/advisories/GHSA-rr9w-vmjp-9cg9