Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessUpload image with oversized GIF comment
-
ExploitApp re-saves image as GIF via Pillow
-
ExecutionQuadratic copying in _get_global_header()
-
ImpactCPU exhaustion and denial of service
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V2 - Validation and Business Logic Algorithmic complexity limits
|
| Exploitation Conditions | Exploitation requires an application built on Pillow 9.2.0 up to (but not including) 13.0.0 that accepts an attacker-supplied input image and saves/re-encodes it as GIF while retaining the embedded comment from the untrusted source. The specific trigger is a GIF (or convertible image) carrying a very large comment extension block, which drives the quadratic copy loop in _get_global_header(). The practical limiting factor is the save-as-GIF-with-comment workflow: services that never output GIF, or that strip comments before saving, are not affected. No authentication or user interaction is needed per the vector (PR:N/UI:N), but the vulnerable code path must actually be reachable with attacker-controlled comment data. |
| Impact | This is a genuine but moderate-severity availability issue, not a top-tier emergency. The input CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N) with only VA:L and no confidentiality/integrity impact correctly characterizes it as an algorithmic-complexity denial of service (CWE-407): quadratic copying in GIF _get_global_header() when a large comment is present. No EPSS score, KEV listing, or POC was provided, so the exploitation signal is weak - this maps to 'no public exploit identified at time of analysis.' The score of 6.9 is driven purely by easy network reachability, not by impact depth: the worst realistic outcome is CPU exhaustion / slow or denied service for the processing worker, with no code execution or data exposure. Note a tag/impact conflict: the input Tags label this 'Information Disclosure,' which contradicts the CVSS vector (VC:N, VI:N, VA:L) and the description - this is strictly an availability/DoS flaw, so the 'Information Disclosure' tag appears mislabeled and should be disregarded. Priority should be driven by whether an exposed application actually re-saves untrusted images as GIF. |
| Exploit ScenarioDerived | An attacker uploads an image containing an oversized GIF comment to a web service that uses Pillow to re-encode or save user-supplied images as GIF. During save, _get_global_header() repeatedly copies the retained comment data, producing quadratic CPU cost that stalls the worker and degrades or denies service for other users. No public exploit code was identified, but the trigger is trivial to construct from the public description and commit. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 19, 2026
Saving attacker-controlled images as GIF in Python Pillow 9.2.0 through 12.x can drive quadratic comment-header assembly and consume excessive CPU, delaying or denying service. The issue is reachable without authentication or user interaction (assessed CVSS:3.1 AV:N/AC:L/PR:N/UI:N), but only when an application preserves a very large embedded GIF comment and re-encodes the image as GIF; impact is limited to availability. No public exploit code or CISA KEV entry was identified in the supplied intelligence, and the vendor-released fix is Pillow 13.0.0.
RemediationAI
Upgrade to Pillow 13.0.0, which contains the vendor-released fix; see the advisory at https://github.com/python-pillow/Pillow/security/advisories/GHSA-fc9g-5qg7-mf45, the fix commit at https://github.com/python-pillow/Pillow/commit/68a3fe957d8a4d552e8c69d96066d749f0614c7e, and the release at https://github.com/python-pillow/Pillow/releases/tag/13.0.0. If an immediate upgrade is not possible, remove or refuse embedded comments before GIF save (for example, strip the comment from the image metadata rather than preserving untrusted info["comment"]); this loses benign caption metadata and may break workflows that depend on comments. Applications can also disable GIF re-encoding of untrusted images, enforce strict limits on input file size and GIF comment/subblock length, and run conversion in a sandboxed process with CPU and time quotas; these controls reduce functionality or throughput, and aggressive timeouts may abort legitimate large image jobs.
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
This is an algorithmic-complexity issue (CWE-407) in Pillow's GIF handling. GIF comment extension blocks can carry arbitrary byte data, and Pillow previously assembled the global header by repeatedly concatenating comment subblocks into a growing buffer in _get_global_header(); the repeated copying scales quadratically with comment size. The related _seek() logic also repeatedly appended to the stored info["comment"], so comments retained from an untrusted input image could amplify the work when the image was later saved as GIF. Commit 68a3fe957d8a4d552e8c69d96066d749f0614c7e changes the code to collect comment blocks and header blocks in lists and join or append them without repeated large-buffer copies. The supplied CPE cpe:2.3:a:python-pillow:pillow:*:*:*:*:*:*:*:* identifies the Pillow package, while the advisory-defined vulnerable range is 9.2.0 up to, but not including, 13.0.0. The vulnerable path is not reached merely by opening a GIF; exploitation depends on an application saving or re-encoding attacker-supplied content as GIF while retaining the embedded comment.
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
Network-reachable via image upload with no auth or interaction (AV:N/AC:L/PR:N/UI:N); availability-only CPU-exhaustion DoS with no confidentiality or integrity impact (C:N/I:N/A:L).
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
Pillow is a Python imaging library. From 9.2.0 until 13.0.0, Pillow performs quadratic copying when saving a GIF with a long comment. _get_global_header() repeatedly copies portions of comment data while assembling the global header, including comments retained from an untrusted input image. An attacker can supply an image with a large GIF comment to an application that saves it as GIF. This can consume excessive CPU and delay or deny service. This issue is fixed in version 13.0.0.
Blast Radius
ecosystem impact- 180 pypi packages depend on pillow (154 direct, 27 indirect)
Ecosystem-wide dependent count for version 9.2.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-104649
GHSA-fc9g-5qg7-mf45
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB