CVE-2026-112401: Pillow: Quadratic GIF comment concatenation allows DoS in Image.open()
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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Pillowto a version that resolves this vulnerability.Fixed in 13.0.0
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications using Pillow versions from 5.4.0 through versions before 13.0.0 are exposed if they open attacker-controlled GIF files. The issue is triggered while parsing frame zero during Image.open(), before the application can inspect the image.
What must an attacker provide to trigger the denial of service?
An attacker needs to submit a GIF crafted with many comment extensions or comment sub-blocks. The GIF can have small image dimensions, so dimension-based checks alone do not prevent the excessive CPU consumption.
Is authentication or user interaction required for exploitation?
No. The supplied CVSS vector indicates network reachability with low attack complexity and no privileges or user interaction required, provided an application opens the attacker-supplied GIF.
What version fixes the issue?
Pillow 13.0.0 fixes the quadratic copying behavior. Upgrade deployments using affected Pillow releases to version 13.0.0.