CVE-2026-112891: Medium severity pypi/Pillow vulnerability
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. getglobalheader() 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.
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 9.2.0 through versions before 13.0.0 are exposed if they accept GIF images from untrusted sources and save or re-save them as GIF files. The risk is tied to processing images that contain large GIF comments.
What must an attacker do to trigger the denial of service?
An attacker must provide a GIF containing a large comment to an application that later saves the image as a GIF. During GIF header construction, Pillow repeatedly copies comment data, causing excessive CPU consumption.
Is authentication or user interaction required?
No. The supplied CVSS vector indicates network reachability with low attack complexity, no privileges required, and no user interaction required; however, the application must process and save the attacker-controlled GIF as GIF.
What is the remediation?
Upgrade Pillow to version 13.0.0, which fixes the issue. If upgrading is not immediately possible, avoid saving untrusted GIF inputs as GIF files, particularly inputs that may retain embedded comments.