CVE-2026-112894

Pillow: Quadratic-time DoS in PDF save_all (PdfParser.next_object_id)

Published Oct 19, 2026 CVSS 4.0 · 8.7 High EPSS < 1% KEV · Not listed
Description
Pillow is a Python imaging library. From 5.1.0 until 13.0.0, Pillow takes quadratic time to reserve PDF object identifiers when saving many frames with save_all enabled. PdfParser.next_object_id() repeatedly rebuilds and scans all previously reserved identifiers for every object. An attacker can supply a multi-frame image, including a small APNG with a large declared frame count, to an application that converts it to a multipage PDF. This can consume excessive CPU and deny service. This issue is fixed in version 13.0.0.

Analysis

AI-generated

Technical impact

Pillow, the Python imaging library, uses a method that scales quadratically in time when saving a multi-frame image to PDF with the save_all option. Each frame causes the library to rebuild and scan all previously reserved PDF object identifiers, so an attacker can send a deliberately crafted image with many frames, such as a small APNG declaring a large frame count, and force the application to consume large amounts of CPU. The effect is a performance degradation that can lead to a denial of service for the running process or hosting environment. This weakness is recognized as CWE-407 and CWE-770.

Affected Systems

Any Python application that uses Pillow to convert images to PDF and supports the save_all feature is affected. The flaw exists across Pillow versions 5.1.0 through 13.0.0, inclusive. Applications that process user-supplied or untrusted images are most at risk, especially those that automatically convert or render images to PDF formats.

Risk and Exploitability

The CVSS score of 8.7 indicates a high severity. Because the EPSS score is unavailable, the current exploitation probability is unclear, and it is not listed in CISA's KEV catalog. Attackers can exploit the vulnerability by supplying a crafted multi-frame image whenever the application performs a PDF save_all operation. The vulnerability provides local or remote exploitation potential depending on the context in which the Pillow library is invoked; however, no authentication or privilege escalation is required, making it a straightforward denial‑of‑service vector. Upgrading to Pillow 13.0.0 eliminates the quadratic time behavior and removes the attack surface. This flaw also falls under CWE-770, indicating a resource exhaustion weakness.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Pillow to v13.0.0 or later.
  • If an upgrade is not immediately possible, validate and enforce a maximum number of frames on any image before invoking save_all.
  • Monitor CPU usage of image-processing services and set thresholds to trigger alerts or throttling if anomalous consumption occurs.
  • Apply resource capping or sandboxing to limit memory and CPU usage during Pillow operations, addressing the resource exhaustion nature of the flaw.

Generated by OpenCVE AI on October 20, 2026 at 07:14 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-jg86-v3jv-hrpm Pillow: Quadratic-time DoS in PDF save_all (PdfParser.next_object_id)
History
Type Values Removed Values Added
First Time appeared Python
Python pillow
CPEs cpe:2.3:a:python:pillow:*:*:*:*:*:*:*:*
Vendors & Products Python
Python pillow
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Weaknesses CWE-770
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Important

Type Values Removed Values Added
First Time appeared Python-pillow
Python-pillow pillow
Vendors & Products Python-pillow
Python-pillow pillow
Type Values Removed Values Added
Description Pillow is a Python imaging library. From 5.1.0 until 13.0.0, Pillow takes quadratic time to reserve PDF object identifiers when saving many frames with save_all enabled. PdfParser.next_object_id() repeatedly rebuilds and scans all previously reserved identifiers for every object. An attacker can supply a multi-frame image, including a small APNG with a large declared frame count, to an application that converts it to a multipage PDF. This can consume excessive CPU and deny service. This issue is fixed in version 13.0.0.
Title Pillow: Quadratic-time DoS in PDF save_all (PdfParser.next_object_id)
Weaknesses CWE-407
References
Metrics cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-407

    Inefficient Algorithmic Complexity

  • CWE-770

    Allocation of Resources Without Limits or Throttling

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 20, 2026, 2:46 PM
Reserved
Oct 19, 2026, 8:16 PM
Status
Analyzed
Published
Oct 19, 2026, 10:17 PM
Modified
Oct 27, 2026, 2:56 PM
Severity
Important
Public date
Oct 19, 2026, 9:55 PM