Skip to main content

Pillow EUVDEUVD-2026-104638

| CVE-2026-112401 MEDIUM
Inefficient Algorithmic Complexity (CWE-407)
2026-10-19 GitHub_M GHSA-74r2-7ff9-mjj2
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 small crafted GIF with many comment extensions
  2. Exploit
    Image.open() parses frame zero via GifImageFile._seek()
  3. Execution
    Quadratic byte copying of comment sub-blocks exhausts CPU
  4. Impact
    Service 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.4% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – 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

Pillow 5.4.0, < 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

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

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 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.

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 - 21:15 cve.org
MEDIUM 6.9

DescriptionCVE.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

EPSS Score
0.4%
Top 70% exploitable
Prevalence
High
Pillow is the de facto imaging library across the Python ecosystem
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.4%
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
High
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

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