Integer overflow in Pillow ImageMath divide crashes applications
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Passive
- Attack complexity
- High
- Attack requirements
- Present
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-190 and the CVSS impact.
Summary
Pillow before 13.1.0 contains an integer overflow (CWE-190) in the ImageMath integer divide and modulo operators, which check only for a zero divisor. Dividing the minimum 32-bit integer by -1 raises a hardware divide exception and crashes the process. An attacker can supply a crafted TIFF file that decodes to a mode I image containing that value, crashing applications that run an ImageMath divide or modulo with a -1 operand on it.
Written with Claude Haiku 5.5 from the sources below · 2026-11-30
Description from the CNA
Pillow before 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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| python-pillow | Pillow | before 13.1.0 | 13.1.0 | Patch available | CNA |
- Pillow Vendorpython-pillow Affected before 13.1.0 Fixed in 13.1.0 Patch available CNA
CPE names Threatist (inferred) · 1
Inferred from how NVD named this product before; not given by a source.
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:python:pillow:*:*:*:*:*:*:*:* | — | — | python-pillow |
- cpe:2.3:a:python:pillow:*:*:*:*:*:*:*:* Versions — — ·python-pillow
Remediation
Upgrade Pillow to version 13.1.0 or later. The sources list no fixed version for any other product.
Written with Claude Haiku 5.5 from the sources below · 2026-11-30
- Fix · CNA Pillow (python-pillow) Fixed in 13.1.0
Timeline
- 2026-11-27 Threatist record created from CVE-2026-137940
- 2026-11-27 Alias added: GHSA-fmhg-jj2c-g77v
- 2026-11-30 Title updated · CNA
- 2026-11-30 Fix available: [email protected] · CNA
References
More python-pillow vulnerabilities
- TI-2016-01993 The DES and Triple DES ciphers, as used in the TLS, SSH, and IPSec protocols and other… CVSS 3.1HIGH 7.5
- TI-2022-24108 An XML External Entity (XXE) issue was discovered in Python through 3.9.1. CVSS 3.1CRITICAL 9.8
- TI-2022-17508 The Keccak XKCP SHA-3 reference implementation before fdc6fef has an integer overflow and… CVSS 3.1CRITICAL 9.8
- TI-2021-02254 Python 3.x through 3.9.1 has a buffer overflow in PyCArg_repr in _ctypes/callproc.c… CVSS 3.1CRITICAL 9.8
- TI-2007-04413 Directory traversal vulnerability in the (1) extract and (2) extractall functions in the… CVSS 3.1CRITICAL 9.8
- TI-2026-76627 Out-of-bounds read in Pillow TIFF encoder ColorMap handling CVSS 4.0HIGH 8.8
Sources
- CVE-2026-137940 · CVE Program
- CVE-2026-137940 · NVD
- FIRST EPSS
- GHSA-fmhg-jj2c-g77v · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences