Skip to main content

Python Pillow CVE-2026-59198

| EUVDEUVD-2026-43752 HIGH
Out-of-bounds Read (CWE-125)
2026-07-14 GitHub_M GHSA-fj7v-r99m-22gq
7.5
CVSS 3.1 · NVD
View

Attack ChainAIDerived

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

  1. Access
    Submit input driving mode-1 image
  2. Delivery
    App saves TGA with tga_rle compression
  3. Exploit
    Encoder overreads packed row buffer
  4. Execution
    Adjacent heap bytes written into output file
  5. Impact
    Retrieve TGA and extract leaked memory

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, read limits
MITRE ATT&CK

1 technique across 1 tactic: Collection

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 host application to save an image in Pillow's 1-bit mode '1' using the TGA format with run-length encoding enabled (compression='tga_rle') on an affected version (5.2.0 through 12.2.x), and the attacker must be able to obtain the resulting TGA file. It does NOT trigger on other image modes, on uncompressed TGA saves, or on formats other than TGA-with-RLE, and the attacker cannot choose which heap bytes leak - only a bounded run of adjacent process memory is exposed. The key limiting factor is that the vulnerable save configuration is uncommon and typically controlled by the application, not the attacker, so despite the PR:N/AC:L CVSS metrics this is not exploitable against a default deployment unless the app specifically performs mode-1 tga_rle encoding on attacker-reachable data.

Impact

Signals conflict and should be read carefully. The published CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/C:H) yields 7.5 and implies trivial remote confidentiality loss, but the description makes clear exploitation requires an application to save a mode '1' image with TGA RLE compression - an operation an attacker rarely controls directly, so real-world attack complexity is higher than AC:L suggests and the network vector is indirect at best. There is no KEV listing and no EPSS score supplied, and the only public code is the vendor fix itself (a PR/commit), not a weaponized exploit, so this is 'no public exploit identified at time of analysis.' The leaked data is a bounded amount of adjacent heap, not attacker-chosen memory, so confidentiality impact is realistically limited (I judge C:L, not C:H). Net: a legitimate memory-disclosure bug worth patching, but a low-urgency issue rather than an emergency - closer to high-CVSS-but-modest-real-risk unless an application both auto-produces mode-1 tga_rle output and exposes it to an attacker.

Exploit ScenarioDerived

An application uses Pillow to convert user-uploaded or generated 1-bit bitmaps to compressed TGA (compression='tga_rle') and then returns the resulting file to the requester. Because the RLE encoder overreads the packed row buffer, the returned TGA contains stray bytes of the server process's heap, which an attacker can harvest across many requests to reconstruct fragments of secrets. No public exploit or POC is known; only the vendor fix diff is available.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

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

Alert me

AnalysisAIv2 – Jul 14, 2026

Out-of-bounds heap read in Python Pillow's TGA RLE encoder (versions 5.2.0 through 12.2.x) lets adjacent process heap bytes leak into a generated TGA file when an application saves a mode '1' (1-bit) image using compression='tga_rle'. The flaw is an information-disclosure bug (CWE-125), fixed in 12.3.0, with no public exploit identified at time of analysis. The NVD CVSS of 7.5 (network vector) overstates practical reach because triggering the leak depends on the host application invoking this specific and unusual save path.

Earlier versions of this analysis (1)
v1 Jul 14, 2026 - 16:36 CVSS 6.5

Pillow's TGA RLE encoder (versions 5.2.0 through 12.3.0) performs an out-of-bounds heap read when saving a mode 1 (1-bit monochrome) image with TGA RLE compression, copying adjacent process heap bytes directly into the output TGA file and enabling memory disclosure. Applications that accept untrusted image inputs, convert them to mode 1, and write TGA RLE output expose sensitive in-process heap content - such as session tokens or cryptographic material - to any party that can retrieve the output file. No public exploit code has been identified at time of analysis, and this issue is not listed in CISA KEV; the High attack complexity in the CVSS vector reflects that this non-default code path significantly constrains real-world exploitability.

RemediationAI

Vendor-released patch: upgrade to Pillow 12.3.0 or later (pip install --upgrade Pillow>=12.3.0), which resolves the leak by rejecting mode '1' images with TGA RLE compression rather than encoding them. If you cannot upgrade immediately, the concrete compensating control is to avoid the vulnerable code path entirely: do not call im.save(..., compression='tga_rle') on 1-bit ('1' mode) images - either save such images without RLE compression (compression=None, producing uncompressed TGA at the cost of larger files) or convert them to a supported mode (e.g. im.convert('L') or 'P') before RLE-saving. Applications that let untrusted input drive image mode/format/compression should validate and constrain those parameters. Reference the advisory GHSA-fj7v-r99m-22gq, PR https://github.com/python-pillow/Pillow/pull/9709, and commit eada3cbd7fb9963ee90673fb7b5270124a0d5f4b.

Affected VersionsENISA

Pillow 5.2.0, < 12.3.0

Affected Packages

pypi pillow fix: 12.3.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 (python-pillow, CPE cpe:2.3:a:python-pillow:pillow) is one of the most widely used Python imaging libraries. The defect lives in TgaImagePlugin.py's RLE (run-length encoding) save routine: when encoding a 1-bit ('1' mode) image, the encoder reads past the end of its packed row buffer, so uninitialized/adjacent heap memory is copied into the RLE-compressed pixel data written to the output TGA file. This is a classic CWE-125 out-of-bounds read at the buffer boundary; the root cause is that the RLE packer's byte-per-pixel assumptions do not hold for the tightly packed 1-bit row representation. The upstream fix (PR #9709, commit eada3cbd) does not repair the packer but instead outright rejects the unsupported combination, raising OSError 'cannot write mode 1 as TGA with run-length encoding'.

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 MEDIUM
NVD 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
vuln.today AI 3.7 LOW

AC:H because exploitation needs the app to save a mode-1 image with tga_rle and expose the output; C:L as only a bounded run of adjacent, non-attacker-chosen heap leaks; no integrity or availability impact.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
SUSE 5.1 MEDIUM
AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Red Hat 6.5 MEDIUM

Primary rating from Vendor (GitHub_M).

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

Lifecycle Timeline

4
Severity Changed
Jul 14, 2026 - 20:22 NVD
MEDIUM HIGH
CVSS changed
Jul 14, 2026 - 20:22 NVD
6.5 (MEDIUM) 7.5 (HIGH)
Patch available
Jul 14, 2026 - 18:20 EUVD
CVE Published
Jul 14, 2026 - 16:07 cve.org
MEDIUM 6.5

DescriptionNVD

Pillow is a Python imaging library. From 5.2.0 until 12.3.0, Pillow's TGA RLE encoder reads past its packed row buffer when saving a mode 1 image with TGA RLE compression, allowing adjacent process heap bytes to be copied into the generated TGA file. This issue is fixed in version 12.3.0.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 21 pypi packages depend on pillow (21 direct, 0 indirect)

Ecosystem-wide dependent count for version 5.2.0.

Executive ViewAI

Why It Matters

Python Pillow image processing library versions 5.2.0 through 12.2.x contain a memory-disclosure vulnerability in the TGA file encoder that can leak sensitive heap data when processing specific image formats, potentially exposing confidential information for any organization using Pillow to generate or transform images. This affects web applications, image processing services, and any infrastructure handling image operations.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.3%
Top 77% exploitable
Prevalence
High
Pillow is among the most widely deployed Python imaging libraries
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

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.3%
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
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Partial

Priority Score

58
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
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.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

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-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-2021-23437 HIGH POC
7.5 Sep 03

The package pillow 5.2.0 and before 8.3.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the getrgb

CVE-2025-48379 HIGH POC
7.1 Jul 01

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

CVE-2016-4009 CRITICAL
9.8 Apr 13

Integer overflow in the ImagingResampleHorizontal function in libImaging/Resample.c in Pillow before 3.1.1 allows remote

CVE-2014-3007 CRITICAL
10.0 Apr 27

Python Image Library (PIL) 1.1.7 and earlier and Pillow 2.3 might allow remote attackers to execute arbitrary commands v

CVE-2021-34552 CRITICAL
9.8 Jul 13

Pillow through 8.2.0 and PIL (aka Python Imaging Library) through 1.1.7 allow an attacker to pass controlled parameters

CVE-2021-25289 CRITICAL
9.8 Mar 19

An issue was discovered in Pillow before 8.1.1. Rated critical severity (CVSS 9.8), this vulnerability is remotely explo

CVE-2020-5312 CRITICAL
9.8 Jan 03

libImaging/PcxDecode.c in Pillow before 6.2.2 has a PCX P mode buffer overflow. Rated critical severity (CVSS 9.8), this

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Module for Package Hub 15 SP7 Fixed
openSUSE Tumbleweed Fixed
SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS Affected
SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS Affected
SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS Affected

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