Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessUpload small crafted GIF with many comment extensions
-
ExploitImage.open() parses frame zero via GifImageFile._seek()
-
ExecutionQuadratic byte copying of comment sub-blocks exhausts CPU
-
ImpactService degraded or denied
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V2 - Validation and Business Logic Algorithmic complexity limits
|
| Exploitation Conditions | No special configuration is required - any application using Pillow versions 5.4.0 through pre-13.0.0 that calls Image.open() on an attacker-supplied GIF is exploitable against default behavior, because frame zero (including comment extensions) is parsed automatically on open. The specific trigger is a GIF containing many comment extensions / comment sub-blocks, which drives quadratic copying in GifImageFile._seek(). Limiting factors: the attacker must be able to get a malicious GIF processed by the target (e.g. an upload, avatar, or thumbnail pipeline); impact is bounded to availability/CPU (VA:L) with no code execution or data exposure; and environments that only process trusted images are not practically exposed. |
| Impact | This is a denial-of-service issue (CWE-407, inefficient algorithmic complexity) with a vendor-provided CVSS 4.0 score of 6.9. The vector AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N is internally consistent with the description: remote, low-complexity, unauthenticated, no user interaction, and impact limited to availability only (VA:L - no confidentiality or integrity effect). No EPSS score was supplied, the CVE is NOT on CISA KEV, and no public exploit code is referenced, so the exploitation status is: no public exploit identified at time of analysis. The signals are coherent rather than conflicting - this is a genuine, easily-triggered DoS against any service that opens untrusted GIFs with Pillow, but the impact ceiling is low (CPU exhaustion / service slowdown, not RCE or data loss), which is why the score lands in the medium range rather than high/critical. Priority should be driven by exposure: high for services that accept user-uploaded images, low for environments that only process trusted files. Note: the input Tag 'Information Disclosure' contradicts the CVSS (VC:N/VI:N) and the description - this is purely an availability flaw, not information disclosure. |
| Exploit ScenarioDerived | An attacker uploads a small-dimension GIF crafted with a large number of comment extension sub-blocks to any application that opens images with Pillow (e.g. an image-upload or thumbnailing endpoint). Because frame zero is parsed during Image.open() and comment bytes are copied quadratically in GifImageFile._seek(), a tiny file forces disproportionate CPU consumption and degrades or denies service before the app can even inspect the image. No public exploit code is referenced, but the trigger is trivial to reproduce from the description. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 19, 2026
Denial of service in Pillow 5.4.0 through pre-13.0.0 allows unauthenticated remote attackers to exhaust CPU by supplying a crafted GIF containing numerous comment extensions; Image.open() parses frame zero and triggers quadratic bytes copying in GifImageFile._seek() before the application can inspect the image. Impact is limited to availability (vendor CVSS 4.0 score 6.9; assessed CVSS 3.1 vector AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L), with no code execution or data exposure. No public exploit code or confirmed active exploitation was identified at time of analysis, and environments that only open trusted images are not practically exposed.
RemediationAI
Upgrade to Pillow 13.0.0, the vendor-released patch version (release tag https://github.com/python-pillow/Pillow/releases/tag/13.0.0; upstream fix commit 68a3fe957d8a4d552e8c69d96066d749f0614c7e; advisory https://github.com/python-pillow/Pillow/security/advisories/GHSA-74r2-7ff9-mjj2). If immediate upgrade is not possible, sanitize or reject GIFs with excessive comment extensions or comment sub-blocks before calling Image.open(), for example by stripping GIF comment extensions in the upload pipeline or re-encoding images, with the trade-off of metadata loss and possible rejection of legitimate animated GIFs that contain many comments. Isolate image parsing in a worker process with strict CPU-time and wall-clock timeouts plus resource limits, accepting that legitimate large or slow images may be terminated and that limits must be tuned to avoid availability regressions. File-size limits alone are insufficient because the crafted GIF can be small in dimensions and byte size; additionally avoid opening untrusted images in latency-sensitive or shared processes, since frame zero is parsed automatically on open.
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
Pillow's GIF plugin parses GIF comment extensions, which are encoded as a chain of sub-blocks terminated by a zero-length block. In GifImageFile._seek(), versions 5.4.0 through pre-13.0.0 accumulated comment data using immutable bytes concatenation (comment += block and info["comment"] += b"\n" + comment), causing repeated copying that scales quadratically with the number of comment sub-blocks and multiple comment extensions. Because frame zero is parsed during Image.open(), the excessive CPU work occurs before application-level image inspection or validation. The root cause is CWE-407, inefficient algorithmic complexity, and the CPE cpe:2.3:a:python-pillow:pillow:*:*:*:*:*:*:*:* identifies the affected Python imaging library. The upstream fix commit 68a3fe957d8a4d552e8c69d96066d749f0614c7e changes comment parsing to append blocks to a list and join them once (b"".join(comment_blocks)), and similarly assembles the global header as a list, eliminating the quadratic copying behavior.
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 GIFs with no user interaction (AV:N/AC:L/PR:N/UI:N); impact is partial CPU-exhaustion DoS only, so A:L and C:N/I:N.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
Pillow is a Python imaging library. From 5.4.0 until 13.0.0, Pillow performs quadratic copying while parsing GIF comments. GifImageFile._seek() repeatedly appends immutable bytes for comment sub-blocks and multiple comment extensions, and frame zero is parsed during Image.open(). An attacker can submit a small-dimension GIF containing many comment extensions to any application that opens the file. This can consume excessive CPU and deny service before the application can inspect the image. This issue is fixed in 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
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-104638
GHSA-74r2-7ff9-mjj2
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB