# CVE-2026-137940: Pillow before 13.1.0 Crash via ImageMath INT32\_MIN Division by -1

- Priority: **Routine**
- Reason: Not severe (CVSS 5.7, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-11-27 · Modified: 2026-12-01
- Aliases: DEBIAN-CVE-2026-137940, UBUNTU-CVE-2026-137940
- Record: https://cvemate.com/vulnerability/CVE-2026-137940 · JSON: https://cvemate.com/vulnerability/CVE-2026-137940/json

## Description

```text
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.
```

## Signals

- CVSS: 5.7 medium (v4.0, CVE.org) 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
- EPSS: 0.172%, percentile 6.887%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- debian pillow (Debian): All versions (No fix recorded)
- ubuntu pillow (Ubuntu): All versions (No fix recorded)
- ubuntu pillow-python2 (Ubuntu): All versions (No fix recorded)
- python-pillow pillow: \< 13.1.0

## References

- <https://github.com/python-pillow/Pillow/security/advisories/GHSA-rr9w-vmjp-9cg9>
- <https://github.com/python-pillow/Pillow>
- <https://security-tracker.debian.org/tracker/CVE-2026-137940>
- <https://ubuntu.com/security/CVE-2026-137940>
- <https://www.cve.org/CVERecord?id=CVE-2026-137940>

---

Data as of 2026-12-05T03:16:29.100Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
