Skip to content
FlawDB
Sign in

CVE-2026-137940

MEDIUM 5.7

Pillow through 13.1.0 Crash via ImageMath INT32_MIN Division by -1

AI summary AI generated

An attacker can crash applications using Pillow by supplying a crafted TIFF that triggers an INT32_MIN divided by -1 integer overflow in ImageMath operations.

Mitigation

  • No fix listed yet: follow the vendor advisory.

Who should check

  • Anyone running python-pillow Pillow <= 13.1.0

Vulnerability facts

Affected
python-pillow Pillow <= 13.1.0
Fixed in
No fix listed yet
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Not remotely exploitable (local or adjacent access needed)
CVSS
5.7 (v4.0, CNA)CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NOpen in CVSS calculator
Show all 11 CVSS metrics
  • Attack vector: Local
  • Attack complexity: High
  • Attack requirements: Present
  • Privileges required: None
  • User interaction: Passive
  • Confidentiality impact: None
  • Integrity impact: None
  • Availability impact: High
  • Confidentiality impact on other systems: None
  • Integrity impact on other systems: None
  • Availability impact on other systems: None
CWE
CWE-190
Published
Modified

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.

Affected and fixed versions

Package / productAffectedFixedSource
python-pillow Pillow<= 13.1.0—cvelist

Versions mentioned in the description AI generated

Extracted by AI; each line quotes the description word for word. Source data above takes precedence.

  • Affected: pillow Pillow through 13.1.0 contains an integer overflow in the ImageMath integer divide and modulo operators Pillow through 13.1.0

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2026-137940. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-137940.md
Affected: python-pillow Pillow <= 13.1.0
Fixed in: no fixed version listed yet

Steps:
1. Search this machine and project for python-pillow Pillow: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

Technologies

References

FAQ

Is CVE-2026-137940 being exploited?

There is no confirmed exploitation: CVE-2026-137940 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

How serious is CVE-2026-137940?

Medium: CVSS 5.7 (v4.0, scored by CNA). Not remotely exploitable (local or adjacent access needed). A user has to take an action, such as opening a link, for the attack to work. The attack needs conditions outside the attacker's control, which makes it harder.

Which versions are affected by CVE-2026-137940?

python-pillow Pillow <= 13.1.0.

Is there a fix for CVE-2026-137940?

No fixed version is listed in the sources yet. No fix listed yet: follow the vendor advisory.

How do I check if I'm affected by CVE-2026-137940?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

See all
Vulnerabilities, newest first
SeverityIdentifier / vulnerabilityTechnologySignalsAge
HIGH 8.4CVE-2026-128067

Pillow: Heap buffer overflow saving TIFF with libtiff when tags override image size

PyPI packages
EPSS 38%
HIGH 8.7CVE-2026-128066

Pillow: Memory DoS in TIFF and EXIF IFD parsing via overlapping tag data

PyPI packages
EPSS 38%
Sponsors