Pillow
CVE-2026-128067
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessUpload image with crafted geometry metadata
-
DeliveryService re-saves as compressed TIFF preserving EXIF/IFD
-
ExploitTags override libtiff scanline size past row buffer
-
Executionlibtiff over-reads or (Predictor=2) over-writes heap
-
ImpactExfiltrate heap bytes in output or crash process
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, write limits
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Privilege Escalation The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the target application to save an image as a TIFF through the libtiff encoder - i.e. any compression= other than raw (or TiffImagePlugin.WRITE_LIBTIFF) - while carrying attacker-controlled metadata into the save via exif=im.getexif(), tiffinfo=, or by re-saving a crafted source TIFF whose own IFD supplies the tags. The specific controllable tags are ImageWidth (256), ImageLength (257), SamplesPerPixel (277, for single-band modes L/P/I;16/1), and PlanarConfiguration (284); the out-of-bounds WRITE additionally requires TIFF Predictor=2 (tag 317) to be carried over. LIMITING FACTORS: the flaw is not triggered by a plain decode or by a raw/uncompressed save, and PlanarConfiguration=2 alone is noted as NOT established to cause the out-of-bounds access; the application must perform a metadata-preserving compressed-TIFF save, so services that strip metadata or do not re-encode to TIFF are not exposed. No attacker authentication or user interaction is needed once such a save path processes the uploaded image. |
| Impact | The CVSS 4.0 vector (CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:H, base 8.4) signals a network-reachable, unauthenticated flaw with no user interaction but a non-null Attack Requirement (AT:P): exploitation is only reachable when the target application saves uploaded content as a compressed TIFF through libtiff AND carries source metadata across via exif=/tiffinfo= or a re-saved source IFD. That AT:P is the decisive nuance - raw CVSS magnitude looks critical-adjacent, but real risk is gated on a specific, though common, image-processing idiom rather than any default Pillow behavior. No EPSS score is provided in the input, and the CVE is NOT listed in CISA KEV, so there is no evidence of active or widespread exploitation; this is a recently disclosed issue with a published advisory rather than an in-the-wild campaign. The GHSA advisory contains detailed, runnable reproducers for the heap over-read (information disclosure of live heap, including pointers, into the output file) and, with Predictor=2, an out-of-bounds heap write that reliably aborts the process; however, the write case is characterized in the advisory as byte-wise corruption of existing heap contents with only a glibc abort demonstrated - code execution is NOT established. The vuln.today Decision label is 'this_week', consistent with a serious, patch-this-cycle issue rather than an emergency. Net: a genuine high-severity memory-safety bug worth prioritized patching for any service that converts or re-saves user-supplied images to compressed TIFF, but materially lower real-world urgency than a KEV-listed, default-config RCE. |
| Exploit ScenarioDerived | An attacker uploads a crafted image (e.g. a JPEG whose EXIF declares SamplesPerPixel=3/Photometric=RGB, or ImageWidth=2^27) to a web service that converts or re-saves uploads to compressed TIFF while preserving metadata via exif=im.getexif()/tiffinfo=. libtiff then reads a scanline sized from the attacker's geometry tags out of a buffer sized for the real image, copying adjacent live heap (including pointers that vary per run) into the TIFF returned to the attacker, or crashing the process with an oversized width; with Predictor=2 the oversized scanline is rewritten in place, corrupting the heap. The GHSA advisory publishes working reproducers for both the read and write cases. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 12, 2026
Heap buffer overflow in Pillow's libtiff-based TIFF encoder (all versions 2.3.0 through 12.3.0) lets attacker-controlled geometry tags - ImageWidth, ImageLength or SamplesPerPixel carried via exif=, tiffinfo=, or a re-saved source TIFF's own IFD - make libtiff read a wider scanline than the row buffer Pillow allocates, copying live heap memory (including pointers) into the generated TIFF or crashing the process with SIGSEGV. When TIFF Predictor=2 is also carried over, libtiff's in-place horizontal differencing turns the over-read into an out-of-bounds heap write (glibc abort/SIGABRT), and a PlanarConfiguration=2 value can yield an undecodable output file, though that path is not established to cause the OOB access. Exploitation is not automatic: the application must save uploaded content as a compressed TIFF through libtiff and preserve attacker-supplied metadata; no public exploit code or CISA KEV entry was identified at time of analysis, and a fixed release (13.0.0) is available.
RemediationAI
Upgrade to Pillow 13.0.0, which adds a TIFFScanlineSize64-versus-buffer-size check in ImagingLibTiffEncode and rejects oversized geometry with encoder error -8 (fix commits 53318b50e8e9e85a57d033d4d879e1398d97aeb1 and ec5f1cbcf67275641abaad5c065ffb64a0a804a9, release https://github.com/python-pillow/Pillow/releases/tag/13.0.0, advisory https://github.com/python-pillow/Pillow/security/advisories/GHSA-xcvg-w56q-r89m). Because the vulnerable path requires a metadata-preserving compressed-TIFF save, the effective compensating control is to avoid forwarding untrusted metadata into libtiff: drop exif=/tiffinfo= when saving uploads, or rebuild a clean Exif object containing only benign tags before the save, and do not re-save untrusted TIFFs with their inherited compression and predictor - re-encode to a fixed compression (for example raw or a codec that does not honor a carried Predictor=2) instead. Note these are code changes in the application, not configuration switches, and they forgo metadata preservation in output files; applications cannot rely on Pillow versions below 13.0.0 to validate the geometry tags.
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
Pillow's TiffImagePlugin._save builds the encoder attribute dict by seeding geometry from the actual image (ifd[IMAGEWIDTH] = im.size[0], ifd[IMAGELENGTH] = im.size[1], PlanarConfiguration = 1) and then merging caller- or file-supplied tags over it in the exif=/tiffinfo= loop, while only BitsPerSample is re-pinned to the real image before the libtiff branch; SamplesPerPixel is emitted only for multi-band modes, so for single-band modes (L, P, I;16, 1) a value from the caller's tags or from the source TIFF's IFD (im.tag_v2 via supplied_tags) reaches TIFFSetField. Since tags 256 and 277 are core tags, PyImaging_LibTiffEncoderNew forwards them directly to libtiff. ImagingLibTiffEncode (src/libImaging/TiffDecode.c:1035) then passes a row buffer sized from the real image dimensions (src/encode.c:291-293) to TIFFWriteScanline without comparing it to TIFFScanlineSize(), so libtiff consumes a full tag-described scanline out of a smaller heap allocation - the CWE-787 out-of-bounds write class, realized first as an over-read and, with Predictor=2, as an in-place OOB write. The fix adds a check that TIFFScanlineSize64(tiff) does not exceed state->bytes and raises IMAGING_CODEC_CONFIG (encoder error -8); the tiffinfo= route dates back to Pillow 2.3.0 and the exif= route to 8.4.0.
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:H/VI:L/VA:H/SC:N/SI:N/SA:N
Attacker needs no privileges (just an uploaded image), but exploitation requires the app to save compressed TIFF carrying attacker metadata - a target-side attack requirement, hence AC:H; heap disclosure C:H, limited write I:L, crash A:H.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
DescriptionCVE.org
Pillow is a Python imaging library. From 2.3.0 through 12.3.0, Pillow applications that save compressed TIFF images through libtiff can pass attacker-controlled image geometry tags to the encoder while allocating its row buffer from the actual image dimensions. The affected TiffImagePlugin._save path allows ImageWidth, ImageLength, or SamplesPerPixel from exif=, tiffinfo=, or a source TIFF IFD to make libtiff consume a larger scanline than the buffer supplied by ImagingLibTiffEncode. This can read heap memory into the generated TIFF or crash the process. When TIFF Predictor 2 is enabled, libtiff can rewrite the oversized scanline in place and corrupt memory beyond the buffer. A carried-over PlanarConfiguration value of 2 instead makes libtiff use a shorter scanline and can produce an undecodable output file, but is not established to cause the out-of-bounds access. This issue is fixed in version 13.0.0.
Articles & Coverage 1
Technical POC Analysis
CWE-787 heap out-of-bounds write (with an over-read primitive underneath) in Pillow's libtiff-backed TIFF encoder.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Latest POC
1 PoC candidate from github (unverified)
Sign in to open the public PoC links collected for this CVE.
Executive ViewAI
A heap buffer overflow in Pillow's TIFF encoding library, affecting all versions 2.3.0 through 12.3.0, can be triggered when applications process and re-save attacker-controlled TIFF files with certain metadata. This could lead to memory corruption, potential data leakage, or denial of service. Leadership should prioritize patching because any service that handles user-uploaded images and outputs compressed TIFFs is at risk, potentially exposing sensitive heap data or disrupting operations.
Apply vendor patch: upgrade to Pillow 13.0.0 or later. If immediate patching is not possible, avoid saving untrusted TIFFs with libtiff compression, strip metadata from uploaded TIFFs, or restrict TIFF processing to trusted sources.
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.
Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.
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
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
Uncontrolled memory allocation in the Python Pillow imaging library (all versions prior to 12.3.0) allows a crafted PCF
GHSA-xcvg-w56q-r89m
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB