CVE-2026-137940 Pillow through 13.1.0 Crash via ImageMath INT32_MIN Division by -1

Published Updated

A crafted TIFF can crash applications using Pillow ImageMath DIV_I or MOD_I with a -1 operand; Python apps processing untrusted images should care.

CVSS score

Medium

5.7/10

CVSS 4.0 · Scored by AISLE Breakdown
Exploited in the wild
Not known
Not in CISA's KEV catalogue
Exploit code
None known
No public exploit found
Fix
None listed
No fixed version published
Attack path
Local or same network
No login, a user must click or open something

What is CVE-2026-137940?

CVE-2026-137940 is a medium-severity integer overflow vulnerability in python-pillow Pillow, published on 27 Nov 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-190

How severe is CVE-2026-137940?

CVE-2026-137940 scores 5.7 out of 10 under CVSS 4.0, which is medium severity. It was scored by AISLE.

Attack vector
Local
Attack complexity
High
Attack requirements
Present
Privileges required
None
User interaction
Passive
Confidentiality
None
Integrity
None
Availability
High

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

Which versions are affected by CVE-2026-137940?

An affected version is only exploitable if your software calls ImageMath. Many projects that include it are not exposed.

How do I fix CVE-2026-137940?

No fix has been published for CVE-2026-137940 yet. Limit exposure of the affected software until one is available.

Upgrade to the fixed version. Check arithmetic on sizes and lengths before using the result. More about Integer overflow.

Is CVE-2026-137940 being exploited?

There is no known exploitation of CVE-2026-137940 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2026-137940, GHSA-fmhg-jj2c-g77v.

Is CVE-2026-137940 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free