Ad · Leaderboard 728×90

CVE-2026-112397

8.7High

Published 19 Oct 2026 · NVD status: Received · AI triage by gemini-3.8-flash

8.7High
Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None
Impact
High impact on availability
Weakness
CWE-787

Impact

Remote attackers can crash applications processing untrusted images by triggering an out-of-bounds memory write. They just need to submit a specially crafted zero-width PPM or PGM image that gets passed to Pillow's morphology routine.

Root cause

ImageMorph.MorphOp.apply() writes to outrow[width - 1] without validating against zero-width images, causing an out-of-bounds write before the row buffer.

Affected systems

Pillow versions prior to 13.0.0

CVSS v4.0 · CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Fix & remediation

Upgrade Pillow to version 13.0.0 or higher. If upgrading is delayed, reject or sanitize zero-width PPM and PGM images before applying ImageMorph operations.

shell
$ pip install --upgrade 'Pillow>=13.0.0'

AI-suggested. Run it in staging first and check it against the vendor advisory. Why?

Ad · In-content banner

NVD description

Pillow is a Python imaging library. Prior to 13.0.0, Pillow's ImageMorph.MorphOp.apply() can access memory before a row buffer for a zero-width image. PPM and PGM input can create an image with width zero, and the native morphology routine indexes outrow[width - 1] without rejecting that geometry. An attacker can supply such an image to an application that applies a morphology operation. This can crash the process. This issue is fixed in version 13.0.0.

References

Source: nvd.nist.gov/vuln/detail/CVE-2026-112397

Ad · Sticky 320×50 / 728×90