Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted buffer with P;2L/P;4L rawmode
-
ExploitTrigger out-of-bounds read in ImagingRawDecode
-
ImpactDisclose adjacent heap bytes or crash process
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Buffer over-read prevention
|
| Exploitation Conditions | Exploitation requires that the target application decode attacker-controlled data through Pillow's raw decoder using the planar palette raw modes 'P;2L' or 'P;4L' (for example via Image.frombuffer or Image.frombytes), supplying a buffer and image dimensions whose accepted packed-row size is smaller than the unpacker's padded bit-plane footprint. Limiting factors that reduce real-world exposure: these planar palette raw modes are uncommon and must be explicitly selected by the calling application rather than being triggered by ordinary image-file opening/auto-detection; the impact is bounded to leaking up to three adjacent heap bytes or a process crash, with no code execution or integrity loss. The AT:P metric in the vendor vector reflects this required non-default decoding configuration. |
| Impact | This is a genuine but moderate-severity memory-safety defect (CWE-126 buffer over-read), not a top-tier priority. The provided CVSS 4.0 vector (AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:L, score 6.3) correctly signals a network-reachable, unauthenticated issue with LOW confidentiality and LOW availability impact and NO integrity impact - consistent with the description's claim of disclosing up to three adjacent heap bytes or crashing the process. The pivotal and easily-overlooked metric is AT:P (Attack Requirements: Present): exploitation is not against a passively-parsed image file but requires the application to invoke Pillow's raw decoder with the uncommon 'P;2L' or 'P;4L' rawmodes while passing attacker-influenced buffer contents and dimensions. No EPSS score was provided in the input, so probabilistic exploitation likelihood cannot be quantified. This CVE is NOT in CISA KEV and no public exploit code was supplied, so exploitation status is 'no public exploit identified at time of analysis'; note the fix commit and its regression tests publicly demonstrate the triggering conditions, which lowers the barrier to crafting a POC even though none is cited here. Net: real but low-to-moderate real-world risk - the modest impact ceiling (a few bytes of heap disclosure or a crash) combined with the atypical API precondition means this ranks well below a remote code execution flaw despite Pillow's enormous install base. |
| Exploit ScenarioDerived | An application exposes an endpoint that constructs a Pillow image from user-supplied bytes using Image.frombuffer/frombytes with the 'P;2L' or 'P;4L' raw mode and attacker-influenced dimensions. The attacker submits a buffer whose accepted size is smaller than the unpacker's actual padded-bit-plane footprint, causing ImagingRawDecode to read past the buffer end and either leak up to three adjacent heap bytes into the decoded output or crash the process. No public exploit is identified at time of analysis, though the fix's regression tests publicly illustrate the exact size/mode combinations that trigger the condition. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 19, 2026
Out-of-bounds heap read in Pillow prior to 13.0.0 lets unauthenticated remote attackers disclose up to three adjacent heap bytes or crash the process, but only when the application explicitly decodes attacker-controlled data using the uncommon planar palette raw modes P;2L or P;4L. This is a genuine but moderate-severity CWE-126 memory-safety defect rather than a top-tier priority: these raw modes are not reached by ordinary image-file opening or auto-detection, and impact is bounded to limited information disclosure or denial of service with no code execution or integrity loss. No public exploit identified at time of analysis; the provided intelligence contains no KEV listing and no POC reference.
RemediationAI
Upgrade to Pillow 13.0.0 or later; the vendor-released patch is version 13.0.0, documented at https://github.com/python-pillow/Pillow/releases/tag/13.0.0, with the advisory at https://github.com/python-pillow/Pillow/security/advisories/GHSA-4558-3h8r-v8xp and fixing commit https://github.com/python-pillow/Pillow/commit/392ee6f0d19a4adb766a63e9a99f3c28193b8d31. If upgrading cannot be done immediately, disable or reject application paths that pass untrusted data to Image.frombuffer or Image.frombytes with raw modes P;2L or P;4L, since ordinary image opening and auto-detection do not reach these planar palette modes. As a compensating application-level control, require the supplied buffer length to be at least planes * ((xsize + 7) / 8) for those modes before invoking the raw decoder; this may reject intentionally truncated or non-conforming streams, requires custom validation in the calling application, and does not repair the underlying C size-accounting bug. Running decoding of untrusted input in a constrained subprocess can limit crash and denial-of-service blast radius, but it adds operational overhead and does not prevent the limited heap-byte disclosure.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The root cause is a size-accounting mismatch in Pillow's ImagingRawDecode path for planar palette raw modes P;2L and P;4L. The decoder calculates a packed-pixel row size from bits and xsize, while the corresponding unpackers read separately padded bit planes sized as planes * ((xsize + 7) / 8), so a caller-supplied buffer and image dimensions can pass the accepted-length check even though the unpacker's actual footprint is larger. That produces an out-of-bounds heap read of up to three adjacent bytes, which may be exposed in output pixels or cause a process crash; the available data describes no write primitive, code execution, or integrity impact. The affected CPE is python-pillow:pillow before 13.0.0. The upstream fix commit 392ee6f0d19a4adb766a63e9a99f3c28193b8d31 changes src/decode.c _setimage to compute the planar footprint, rejects P;2L and P;4L in _putpalette_impl, removes the old coarse modulo check from Image.frombytes, and adds regression tests for truncated buffers and decoder buffer sizing. The CVSS 4.0 vendor vector shows AT:P, while the assessed CVSS 3.1 vector is AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L, consistent with remote but non-default decoding configuration being required.
Know when Pillow gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N
AC:H reflects the required non-default P;2L/P;4L raw mode plus a crafted size mismatch (the 4.0 AT:P requirement); PR:N/UI:N as the decode call needs no auth, C:L for a few leaked heap bytes, A:L for the crash, I:N.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
Pillow is a Python imaging library. Prior to 13.0.0, Pillow's P;2L and P;4L raw decoders can read past the end of an input buffer. ImagingRawDecode calculates a packed-pixel row size, while the unpackers read separately padded bit planes. A caller can supply a buffer and image dimensions whose accepted size is smaller than the unpacker's actual footprint. This can disclose up to three adjacent heap bytes in output pixels or crash the process. This issue is fixed in version 13.0.0.
Blast Radius
ecosystem impact- 89,616 pypi packages depend on pillow (20,283 direct, 70,825 indirect)
Ecosystem-wide dependent count for version 13.0.0.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
libImaging/TgaRleDecode.c in Pillow 9.1.0 has a heap buffer overflow in the processing of invalid TGA image files. Rated
Denial of service in Python Pillow (versions 8.2.0 through 12.2.0) allows remote attackers to exhaust memory during JPEG
Out-of-bounds memory disclosure in Python Pillow before 12.3.0 lets an attacker who supplies a crafted McIdas AREA image
Heap out-of-bounds write in Python Pillow prior to 12.3.0 lets an attacker who controls the rank-filter size parameter c
Uncontrolled memory consumption in Python Pillow (PIL) versions 5.1.0 through 12.2.x allows a remote attacker to cause d
The package pillow 5.2.0 and before 8.3.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the getrgb
Pillow is a Python imaging library. In versions 11.2.0 to before 11.3.0, there is a heap buffer overflow when writing a
Integer overflow in the ImagingResampleHorizontal function in libImaging/Resample.c in Pillow before 3.1.1 allows remote
Python Image Library (PIL) 1.1.7 and earlier and Pillow 2.3 might allow remote attackers to execute arbitrary commands v
Pillow versions 11.0.0 through 12.x (fixed in 13.0.0) can reuse a stale native ImagingCore buffer when a multi-frame ima
Pillow through 8.2.0 and PIL (aka Python Imaging Library) through 1.1.7 allow an attacker to pass controlled parameters
An issue was discovered in Pillow before 8.1.1. Rated critical severity (CVSS 9.8), this vulnerability is remotely explo
EUVD-2026-104604
GHSA-4558-3h8r-v8xp
NVD
CVE.org
EPSS
VulDB
Exploit-DB