Pillow
CVE-2026-128066
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted small image to service
-
DeliveryReach Image.open() or getexif() IFD parser
-
ExploitOverlapping tags each read whole-file value
-
ExecutionRetain memory quadratic in file size
-
ImpactExhaust RAM, OOM-kill worker process
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource allocation limits
MITRE ATT&CK
1 technique across 1 tactic: Impact The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | For TIFF and JPEG, no special application configuration is required: parsing occurs inside Image.open() itself (TIFF via tag_v2.load(); JPEG via _read_dpi_from_exif() → getexif() when no JFIF DPI is present), so remote unauthenticated exploitation works against default usage of Pillow <= 12.3.0 that opens attacker-supplied TIFF/JPEG files; the malicious file declares a tiny (e.g. 1×1) image, so MAX_IMAGE_PIXELS and the decompression-bomb check never fire and no warning is raised. For PNG, WebP, and MPO the limiting factor is that EXIF must be actively requested - exploitation requires the application to call getexif(), _getexif(), or ImageOps.exif_transpose() on the uploaded file (common in thumbnail/orientation handling but not automatic on open). The practical constraint on amplitude is file-size headroom: classic TIFF tops out around 48 GiB of requested memory (~786 KB file), while BigTIFF removes the 65,535-entry ceiling; no authentication, no pixel decoding, and no further API call are needed for the TIFF/JPEG cases. |
| Impact | This is a genuine, well-substantiated availability issue rather than an inflated high-CVSS score. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N) describes remote, unauthenticated, low-complexity exploitation with no user interaction, and the impact is cleanly isolated to availability (VA:H; VC/VI/VA confidentiality and integrity are N), consistent with CWE-770 uncontrolled resource consumption and the advisory's explicit statement that there is no memory corruption. The vendor advisory supplies concrete, measured amplification (144 KB TIFF → 1.6 GiB; ~786 KB classic-TIFF maximum → ~48 GiB; BigTIFF uncapped), so the severity is corroborated by reproduction, not merely by metrics. The vuln.today Decision label is 'this_week', which positions it below act_now/emergency urgency - appropriate because the impact is DoS of the processing worker, not code execution or data loss. KEV status is not present in the input, so this is NOT confirmed actively exploited; no EPSS score was provided, so widespread-exploitation probability cannot be quantified from this data. A detailed vendor reproducer is described in the advisory, meaning a public PoC reference exists but the input does not mark it as confirmed distributed working exploit code. Net: credible, easy-to-trigger DoS against a very widely used library, warranting prompt but not emergency patching; the main caveat is that for non-TIFF/non-JPEG formats exploitation depends on the application actually requesting EXIF. |
| Exploit ScenarioDerived | An attacker uploads a small (a few hundred KB) crafted TIFF - or a JPEG with a crafted APP1 EXIF segment - declaring a 1×1 image to any service that calls Image.open() on user-supplied images; the IFD parser allocates and retains memory roughly equal to (number of tags × file size), so an ~800 KB file requests ~48 GiB and the worker is OOM-killed within seconds, dropping all in-flight requests. For PNG/WebP/MPO the same effect is reached when the app calls getexif() or ImageOps.exif_transpose() (as thumbnailers do to honor orientation). A vendor reproducer script is described in the advisory demonstrating both the TIFF (Image.open only) and PNG (getexif) paths; it is not marked as confirmed standalone working exploit code in the input. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 12, 2026
Memory exhaustion in Pillow 1.0 through 12.3.0 lets unauthenticated remote attackers crash or stall any process that parses an attacker-supplied TIFF or JPEG, because Image.open() retains a separate bytes object for every out-of-line IFD tag value with no cap on the total or on overlapping offsets, so memory grows quadratically with file size (a 144 KB TIFF measured at ~1.6 GiB retained, a ~786 KB classic TIFF requests roughly 48 GiB, and BigTIFF removes the 65,535-entry ceiling). PNG, WebP and MPO reach the same code only when the application requests EXIF via getexif(), _getexif() or ImageOps.exif_transpose(), while TIFF and JPEG parse during open itself; the crafted file declares a 1x1 image so decompression-bomb and MAX_IMAGE_PIXELS checks never trigger and no warning is raised. No CISA KEV entry or published EPSS score accompanies this record, and no public exploit is identified at time of analysis, though the upstream advisory includes a reproducer script that constructs the triggering TIFF and PNG files.
RemediationAI
Upgrade to Pillow 13.0.0, the first release containing the fix; the two upstream commits (https://github.com/python-pillow/Pillow/commit/4908edaf7f416616784c7c03d8c1a60153710ffb and https://github.com/python-pillow/Pillow/commit/4b63dffd8a6d980fa0e21b40832fa6cbf033eacf) add a cumulative total_size check against the stream length and skip, with a UserWarning, any tag whose data would push the aggregate beyond the file size, so upgrading is the complete fix and the release notes are at https://github.com/python-pillow/Pillow/releases/tag/13.0.0. Because the vendor's own advisory states that memory use is unbounded during Image.open() and pixel-based decompression-bomb limits do not apply, note that lowering MAX_IMAGE_PIXELS will not help; where upgrading cannot be done immediately, reduce blast radius by decoding images in a separate worker process or thread pool that runs under a hard address-space limit (RLIMIT_AS or a container/process memory cap, accepting that a hostile upload will then kill that worker instead of the main service) and enforce per-request timeouts so a stalled decode is reclaimed; additionally, do not call getexif(), _getexif() or ImageOps.exif_transpose() on untrusted PNG, WebP or MPO uploads unless EXIF is actually required, which removes the non-TIFF exposure paths but has no effect on TIFF or JPEG where parsing happens inside Image.open(), and reject image formats you do not need at the upload boundary as a stop-gap, with the trade-off that any format still accepted remains able to exhaust memory on unpatched versions.
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 flaw sits in ImageFileDirectory_v2.load() in src/PIL/TiffImagePlugin.py, the loop that walks a TIFF image file directory and, for each 12-byte entry whose value is stored out of line, seeks to the attacker-supplied offset and reads 'count * unit_size' bytes via ImageFile._safe_read(), keeping the result in self._tagdata. _safe_read() only guarantees the bytes actually exist in the stream (it is a truncation guard, not a volume guard), so nothing bounds the sum of reads across entries and nothing prevents every distinct tag from pointing at the same file region; N entries each claiming the whole file cost N x filesize while costing only 12 bytes each on disk, making the allocation quadratic in input size. This is CWE-770 (Allocation of Resources Without Limits or Throttling): the root cause is unbounded, unaggregated allocation driven by metadata rather than pixel dimensions, so size-based bomb checks are irrelevant. The same loop is the IFD parser for Image.Exif, which extends exposure beyond TIFF: JpegImagePlugin concatenates APP1 Exif segments and _read_dpi_from_exif() triggers getexif() during Image.open() when no JFIF DPI is present, PngImagePlugin stores the eXIf chunk for parsing on getexif(), and WebP EXIF and MPO use the same path, with each EXIF blob parsed into main, EXIF, GPS and Interop IFDs through separate load() calls. The affected component is the python-pillow pillow package across all versions (CPE cpe:2.3:a:python-pillow:pillow:*:*:*:*:*:*:*:*); the loop predates Pillow's fork from PIL 1.1.7, so the entire 1.0-12.3.0 range is in scope. The upstream fix (commits 4908edaf and 4b63dffd, released in 13.0.0) tracks a cumulative total_size against the real stream length and emits a 'Tag data larger than file. Skipping tag' warning instead of allocating for tags that exceed it. Because out-of-memory is not an OSError, the load() exception handler never fires and the realistic outcome on Linux is the OOM killer terminating the process. The issue is the same class as earlier TIFF-adjacent DoS fixes CVE-2021-27921/27922/27923 and CVE-2021-28675.
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:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Remote parsing during Image.open()/getexif() with no auth or interaction gives AV:N/AC:L/PR:N/UI:N; impact is pure memory-exhaustion DoS, so C:N/I:N and A:H, scope unchanged.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
DescriptionCVE.org
Pillow is a Python imaging library. From 1.0 through 12.3.0, ImageFileDirectory_v2.load() in src/PIL/TiffImagePlugin.py retains a separate bytes object for each out-of-line IFD tag value without limiting the total data read or preventing distinct tags from referencing the same file region. A small crafted TIFF or EXIF-bearing JPEG, PNG, WebP, or MPO can therefore cause memory use quadratic in the input size. TIFF and some JPEG paths trigger parsing during Image.open(), while other formats are exposed when EXIF is requested, including through getexif() or ImageOps.exif_transpose(). The declared pixel dimensions do not bound this metadata allocation, so decompression-bomb checks do not prevent process memory exhaustion. This issue is fixed in version 13.0.0.
Blast Radius
ecosystem impact- 95,835 pypi packages depend on pillow (21,502 direct, 76,026 indirect)
Ecosystem-wide dependent count for version 13.0.0.
Articles & Coverage 1
Technical POC Analysis
CWE-770 (Allocation of Resources Without Limits or Throttling).
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
A high-severity memory exhaustion flaw in Pillow (all versions 1.0 through 12.3.0) allows unauthenticated attackers to crash or stall any service that processes attacker-supplied TIFF or JPEG images. This directly threatens availability of image-processing pipelines, potentially disrupting customer-facing services. Leadership should prioritize remediation because widely used applications relying on Pillow for image uploads are exposed.
No vendor-released patch identified at time of analysis. Interim mitigations include: restricting acceptance of untrusted TIFF/JPEG images; enforcing memory limits and timeouts on image parsing processes; disabling EXIF parsing for PNG/WebP/MPO unless necessary; and validating image dimensions before full processing.
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
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Affected Products (CPE)CVE.org
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
Heap buffer overflow in Pillow's libtiff-based TIFF encoder (all versions 2.3.0 through 12.3.0) lets attacker-controlled
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
Denial-of-service and controlled heap corruption in Python's Pillow imaging library (all versions prior to 12.3.0) occur
Denial of service in Python Pillow 12.0.0 through 12.2.0 lets a remote attacker hang an application by supplying a craft
Denial of service (and potential memory corruption) in Python Pillow before 12.3.0 arises when public image coordinate A
Uncontrolled memory allocation in Python Pillow before 12.3.0 lets a crafted BDF font file exhaust available memory and
Uncontrolled memory consumption in Python Pillow (PIL) versions 5.1.0 through 12.2.x allows a remote attacker to cause d
Denial-of-service via memory exhaustion in Python Pillow before 12.3.0 allows a crafted GD-format (.gd) image to trigger
Uncontrolled memory allocation in Python Pillow before 12.3.0 allows a maliciously crafted font file to trigger excessiv
GHSA-wqgw-9xfh-qf2g
NVD
CVE.org
EPSS
Exploit-DB