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.