Skip to main content

Pillow CVE-2026-128067

HIGH
Out-of-bounds Write (CWE-787)
2026-11-12 GitHub_M GHSA-xcvg-w56q-r89m
8.4
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Upload image with crafted geometry metadata
  2. Delivery
    Service re-saves as compressed TIFF preserving EXIF/IFD
  3. Exploit
    Tags override libtiff scanline size past row buffer
  4. Execution
    libtiff over-reads or (Predictor=2) over-writes heap
  5. Impact
    Exfiltrate 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
1 PoC candidate (unverified) Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

pypi pillow fix: 13.0.0

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

Vendor (GitHub_M) PRIMARY 8.4 HIGH
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
vuln.today AI 7.7 HIGH

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.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:H
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
Low
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

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.

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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.5%
Top 60% exploitable
Prevalence
High
extremely popular Python imaging library; vulnerable path is the compressed-TIFF save route
Threat Intel
1
1 source
Social Media
2
Sightings
Data Quality
4 sources
Confidence: Medium
NVD CVE.org EPSS Vulnrichment GHSA CIRCL GitHub

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Partial

Priority Score

62
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +42
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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

cpe:2.3:a:python-pillow:pillow:*:*:*:*:*:*:*:*

More in Pillow

View all
CVE-2022-30595 CRITICAL POC
9.8 May 25

libImaging/TgaRleDecode.c in Pillow 9.1.0 has a heap buffer overflow in the processing of invalid TGA image files. Rated

CVE-2026-59204 HIGH POC
8.7 Jul 14

Denial of service in Python Pillow (versions 8.2.0 through 12.2.0) allows remote attackers to exhaust memory during JPEG

CVE-2026-54058 HIGH POC
8.3 Jul 14

Out-of-bounds memory disclosure in Python Pillow before 12.3.0 lets an attacker who supplies a crafted McIdas AREA image

CVE-2026-59197 HIGH POC
8.2 Jul 14

Heap out-of-bounds write in Python Pillow prior to 12.3.0 lets an attacker who controls the rank-filter size parameter c

CVE-2026-59205 HIGH POC
7.5 Jul 14

Denial-of-service and controlled heap corruption in Python's Pillow imaging library (all versions prior to 12.3.0) occur

CVE-2026-59203 HIGH POC
7.5 Jul 14

Denial of service in Python Pillow 12.0.0 through 12.2.0 lets a remote attacker hang an application by supplying a craft

CVE-2026-59199 HIGH POC
7.5 Jul 14

Denial of service (and potential memory corruption) in Python Pillow before 12.3.0 arises when public image coordinate A

CVE-2026-55379 HIGH POC
7.5 Jul 06

Uncontrolled memory allocation in Python Pillow before 12.3.0 lets a crafted BDF font file exhaust available memory and

CVE-2026-59200 HIGH POC
7.5 Jul 14

Uncontrolled memory consumption in Python Pillow (PIL) versions 5.1.0 through 12.2.x allows a remote attacker to cause d

CVE-2026-55380 HIGH POC
7.5 Jul 06

Denial-of-service via memory exhaustion in Python Pillow before 12.3.0 allows a crafted GD-format (.gd) image to trigger

CVE-2026-54060 HIGH POC
7.5 Jul 06

Uncontrolled memory allocation in Python Pillow before 12.3.0 allows a maliciously crafted font file to trigger excessiv

CVE-2026-54059 HIGH POC
7.5 Jul 06

Uncontrolled memory allocation in the Python Pillow imaging library (all versions prior to 12.3.0) allows a crafted PCF

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy