CVE-2026-112901 in Pillowinfo

Summary

by MITRE • 10/20/2026

Pillow is a Python imaging library. Prior to 13.0.0, Pillow's XBM header parser is vulnerable to regular-expression denial of service. In XbmImageFile._open, when an application calls Image.open() on a small crafted XBM file, XbmImagePlugin applies a backtracking expression to the attacker-controlled header before image dimensions are accepted, stalling a worker for minutes and denying service. This issue is fixed in version 13.0.0.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 10/20/2026

The vulnerability identified within the Pillow imaging library prior to version 13.0.0 represents a significant availability risk stemming from improper input validation during image file parsing. Specifically, this flaw resides in the XBM header parser, which is responsible for interpreting the metadata of X BitMap files. When an application invokes the Image.open function on a maliciously crafted XBM file, the underlying implementation triggers a regular expression evaluation that exhibits catastrophic backtracking behavior. This type of vulnerability occurs when a regex engine attempts to match a pattern against input data in a way that causes exponential growth in computational steps relative to the length of the input string or specific structural anomalies within it. In this context, the attacker-controlled header contains patterns designed to exploit the non-deterministic polynomial time complexity inherent in certain backtracking regular expression engines used by Python's standard library at the time.

From a technical perspective, the core issue lies in how XbmImagePlugin processes the header information before validating image dimensions. The parser applies a complex regex pattern to extract necessary metadata from the file header. Because the input is attacker-controlled and crafted specifically to trigger worst-case scenarios for the regex engine, the processing thread becomes stuck in an infinite or near-infinite loop of backtracking attempts. This results in the worker process being stalled for minutes, effectively consuming all available CPU resources allocated to that task without making progress toward completing the image loading operation. The lack of a timeout mechanism or input length restriction allows this denial-of-service condition to persist until external intervention is required, such as killing the process or waiting for system-level timeouts to expire.

The operational impact of this vulnerability is primarily centered on service availability and resource exhaustion. For applications that rely on Pillow to process user-uploaded images, particularly those involving XBM formats, a successful exploitation can lead to thread starvation in web servers using synchronous workers like Gunicorn with the sync worker class or similar blocking I/O models. This means that even if only one malicious request is processed, it can block other legitimate requests from being handled by the same worker process, leading to degraded performance for all users of the service. In distributed environments where multiple instances are running, this could contribute to broader system instability if not properly isolated or monitored. The vulnerability does not typically allow for remote code execution but serves as a potent tool for disrupting services through resource consumption attacks.

This flaw aligns with Common Weakness Enumeration (CWE) category CWE-400, which covers Uncontrolled Resource Consumption, and more specifically relates to issues involving regular expression handling that can lead to denial of service conditions. In terms of the MITRE ATT&CK framework, this vulnerability facilitates techniques associated with Denial of Service attacks where adversaries aim to disrupt or deny services to intended users by exhausting resources such as CPU time or memory. The attack vector is classified as remote if the application accepts user-supplied image files over a network interface, making it accessible to external attackers who can submit crafted payloads via HTTP requests or other file upload mechanisms integrated into web applications.

Mitigation strategies for this vulnerability are straightforward and primarily involve updating the Pillow library to version 13.0.0 or later, where the regular expression logic has been revised to prevent catastrophic backtracking. For organizations unable to immediately upgrade due to dependency constraints, implementing input validation at the application layer can provide a temporary defense-in-depth measure. This includes restricting file types strictly to those that are necessary and validating header structures before passing them to the image processing library. Additionally, deploying web application firewalls or reverse proxies with rate limiting and request timeout configurations can help mitigate the impact by terminating long-running requests that exceed expected processing times. Ensuring that worker processes have appropriate timeouts configured will also limit the duration of any potential denial-of-service event caused by such crafted inputs.

Responsible

GitHub M

Reservation

10/19/2026

Disclosure

10/20/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

low

Sources

Want to know what is going to be exploited?

We predict KEV entries!