Skip to main content

Pillow EUVDEUVD-2026-104662

| CVE-2026-112901 MEDIUM
Inefficient Regular Expression Complexity (ReDoS) (CWE-1333)
2026-10-19 GitHub_M GHSA-xgh8-jp6q-p5x8
6.9
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Upload crafted XBM file to service
  2. Delivery
    Application calls Image.open() parser
  3. Exploit
    Backtracking regex processes malicious header
  4. Execution
    Worker CPU stalls for minutes
  5. Impact
    Denial of service for legitimate users

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V2 - Validation and Business Logic Regex complexity 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

Exploitation requires that the target application pass attacker-controlled data to Pillow's Image.open() (or directly invoke XbmImageFile) on content that is parsed as XBM, meaning the service must accept and attempt to decode untrusted image uploads; the malicious input is a small XBM file whose header contains repeated whitespace/characters that trigger catastrophic backtracking before image dimensions are validated. The attack needs no authentication, no user interaction, and works against default Pillow behavior in affected versions (< 13.0.0). Limiting factors: impact is restricted to stalling the processing worker (availability degradation, no code execution or data access), the application must actually route the file through Pillow's XBM parser, and upgrading to Pillow 13.0.0 - which replaces the regex with line-based parsing - fully remediates it.

Impact

This is a real but bounded-severity denial-of-service issue, not a critical priority. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N) confirms remote, unauthenticated, low-complexity reachability with no user interaction, and the impact is confined to availability (VA:L) with zero confidentiality or integrity impact (VC:N/VI:N) - consistent with a CWE-1333 regex denial-of-service that stalls a single worker rather than crashing the host. The vendor-assigned score of 6.9 (Medium) is reasonable; the network vector inflates it, but the real-world impact is a per-request worker stall, not RCE or data exposure. No EPSS score, KEV listing, or POC flag is provided in the input, so there is no signal of active or imminent widespread exploitation. The fix commit does include a regression test (test_redos) containing a concrete reproducing input, which lowers the effort to weaponize, but this is a disclosed-fix reproducer, not evidence of exploitation. Net: a legitimate availability bug worth patching for services that ingest untrusted XBM images, but it does not warrant emergency prioritization over higher-impact flaws. Missing EPSS/KEV data should be verified against CISA KEV and FIRST EPSS before final triage.

Exploit ScenarioDerived

An attacker uploads a small, specially crafted XBM image file to a web service or pipeline that uses Pillow to process user-supplied images. When the application calls Image.open() on the file, the XBM header parser applies a backtracking regular expression to the attacker-controlled header, causing CPU to spin and stalling the worker for minutes. No public weaponized exploit is identified, but the fix commit publishes a reproducing test input that demonstrates the trigger.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.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

AnalysisAIv1 – Oct 19, 2026

Regular-expression denial of service in Pillow before 13.0.0 lets unauthenticated remote attackers stall an image-processing worker by submitting a tiny crafted XBM file that triggers catastrophic backtracking in the XBM header parser before image dimensions are ever validated. Any service that routes untrusted uploads through Image.open() with XBM parsing reachable is affected; impact is confined to availability degradation of the decoding worker, with no code execution, data exposure, or integrity impact. The flaw is fixed in Pillow 13.0.0, which replaces the backtracking regex with line-based parsing; no public exploit tooling or confirmed active exploitation was identified at time of analysis, though the upstream fix commit includes a regression test that reproduces a minimal triggering input.

RemediationAI

Upgrade to Pillow 13.0.0, the release that replaces the vulnerable header regex with bounded line-based parsing; the fix commit is https://github.com/python-pillow/Pillow/commit/2852a3e3d568997ddec745fc800991f138878f4b and the release notes are 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-xgh8-jp6q-p5x8. Because Pillow is usually embedded as a transitive dependency, confirm the version actually imported at runtime (PIL.__version__) in every container image and virtualenv rather than trusting a requirement file, and rebuild pinned base images. If immediate upgrade is not possible, remove XBM from the accepted-format surface: explicitly register only the formats the application needs (JPEG, PNG, WebP, GIF, TIFF) or reject files whose sniffed header begins with "#define", which drops a rarely used legacy format but eliminates the vulnerable code path - note that a plain "#define" text filter is only effective against this specific parser and should not be relied on to reject malformed variants. As a secondary control, run decoding in an isolated worker pool with a hard per-image CPU/wall-clock timeout and a memory cap so a stalled parse kills the single worker instead of exhausting the service; the trade-off is that legitimate large images may need a higher timeout budget, and timeouts only bound the blast radius rather than removing the vulnerability. Rate-limiting unauthenticated upload endpoints reduces the number of concurrent stalling requests but does not prevent a single request from occupying a worker for minutes.

Affected VersionsENISA

Pillow < 13.0.0

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

XBM (X BitMap) is a legacy C-source-style monochrome image format whose header consists of preprocessor-like lines such as "#define name_width 16" and "#define name_height 16". Pillow's XbmImagePlugin previously ran a single backtracking regular expression (xbm_head) against the first 512 bytes of the file inside XbmImageFile._open, and _accept similarly probed the leading prefix for "#define". Because that expression mixed unbounded whitespace/character-class repetition with optional labelled alternatives, an attacker-controlled header containing long runs of spaces or padding characters could drive exponential backtracking, consuming CPU for minutes on an input of only a few hundred bytes. The root cause class is CWE-1333, Inefficient Regular Expression Complexity (ReDoS). The upstream fix (commit 2852a3e3) removes the regex entirely: it reads header lines with readline(75), parses width, height, x_hot and y_hot incrementally with int(), records the byte offset where the _bits[] array begins, and raises SyntaxError when required fields are missing or malformed. The same commit tightens _accept to check for a leading "#define" or "\n#define" prefix without lstrip().

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 6.9 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
vuln.today AI 5.3 MEDIUM

Remote unauthenticated parsing of untrusted input (AV:N/AC:L/PR:N/UI:N); only a single worker is stalled so availability is partial (A:L) with no confidentiality or integrity impact.

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

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

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

Lifecycle Timeline

2
Patch available
Oct 19, 2026 - 23:18 EUVD
CVE Published
Oct 19, 2026 - 22:09 cve.org
MEDIUM 6.9

DescriptionCVE.org

Pillow is a Python imaging library. Prior to 13.0.0, Pillow's XBM header parser is vulnerable to regular-expression denial of service. In XbmImageFile._open, when an application calls Image.open() on a small crafted XBM file, XbmImagePlugin applies a backtracking expression to the attacker-controlled header before image dimensions are accepted, stalling a worker for minutes and denying service. This issue is fixed in version 13.0.0.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 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

EPSS Score
0.3%
Top 80% exploitable
Prevalence
High
Pillow is among the most widely deployed Python imaging libraries
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA 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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

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

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

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-2026-96639 CRITICAL
9.8 Oct 21

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

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

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