CVE-2026-42310 Pillow: PDF Parsing Trailer Infinite Loop (DoS)
An attacker can cause a denial of service by supplying a malicious PDF that triggers an infinite loop in the Pillow library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-42310?
CVE-2026-42310 is a medium-severity denial of service vulnerability in Python Pillow, published on 9 May 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
Pillow is a Python imaging library. From version 4.2.0 to before version 12.2.0, an attacker can supply a malicious PDF that causes the process to hang indefinitely, consuming 100% CPU and making the application unresponsive. This issue has been patched in version 12.2.0.
Weakness: CWE-835
Which versions are affected by CVE-2026-42310?
4 open source packages ship an affected version, including pillow. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
pillow Bitnami | From 4.2.0 | 12.2.0 |
pillow PyPI | From 4.2.0 | 12.2.0 |
pillow PyPI | From 4.2.0 | 12.2.0 |
pillow PyPI | From 4.2.0 | 12.2.0 |
Products include Python Pillow.
How do I fix CVE-2026-42310?
Upgrade pillow to 12.2.0 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2026-42310 being exploited?
There is no known exploitation of CVE-2026-42310 in the wild and no public exploit code.
Other vulnerabilities in Python Pillow
Sources
Also known as BIT-pillow-2026-42310, CLEANSTART-2026-CF65728, CLEANSTART-2026-FQ66823, CLSA-2026-1788340286, CLSA-2026-1788343065, CLSA-2026-1788936404 and 14 more.