Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessUpload crafted XBM file to service
-
DeliveryApplication calls Image.open() parser
-
ExploitBacktracking regex processes malicious header
-
ExecutionWorker CPU stalls for minutes
-
ImpactDenial 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
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
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
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
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.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.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- 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
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.
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
Uncontrolled memory consumption in Python Pillow (PIL) versions 5.1.0 through 12.2.x allows a remote attacker to cause d
The package pillow 5.2.0 and before 8.3.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the getrgb
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
Integer overflow in the ImagingResampleHorizontal function in libImaging/Resample.c in Pillow before 3.1.1 allows remote
Python Image Library (PIL) 1.1.7 and earlier and Pillow 2.3 might allow remote attackers to execute arbitrary commands v
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
Pillow through 8.2.0 and PIL (aka Python Imaging Library) through 1.1.7 allow an attacker to pass controlled parameters
An issue was discovered in Pillow before 8.1.1. Rated critical severity (CVSS 9.8), this vulnerability is remotely explo
EUVD-2026-104662
GHSA-xgh8-jp6q-p5x8
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB