CVE-2026-112399

Pillow: APNG background disposal allocates full canvas before decompression bomb check

Published Oct 19, 2026 CVSS 4.0 · 8.7 High EPSS < 1% KEV · Not listed
Description
Pillow is a Python imaging library. From 8.1.0 until 13.0.0, Pillow can allocate an APNG disposal background at the full canvas size before applying the decompression-bomb check. A crafted APNG with a small first frame, a very large declared canvas, and background disposal or first-frame OP_PREVIOUS reaches PngImageFile._seek while Image.open() positions frame zero. The full-canvas allocation occurs inside Image.open() without requiring pixel loading or frame iteration. This can exhaust memory and deny service. This issue is fixed in version 13.0.0.

Analysis

AI-generated

Technical impact

Pillow, a widely used Python imaging library, can allocate a full-size background buffer for animation PNG (APNG) frames before checking for a decompression bomb. If an attacker supplies an APNG that declares a tiny first frame, a very large canvas, and a background‑disposal operation, Pillow will create a full‑canvas memory allocation inside Image.open() even though no pixel data is processed yet. This out‑of‑bounds allocation flaw (CWE-789) can quickly exhaust the process’s memory and cause a denial‑of‑service without compromising the host system.

Affected Systems

The flaw affects the Pillow library distributed as python-pillow:Pillow and applies to all releases from 8.1.0 up to, but not including, 13.0.0. Any application that loads PNG or APNG files—such as web image upload handlers, server‑side image converters, or desktop graphics tools—running those Pillow versions may be impacted.

Risk and Exploitability

The CVSS score of 8.7 indicates a high‑severity condition. EPSS is not available, and the vulnerability is not listed in CISA's KEV catalog, but the lack of these metrics does not reduce the risk. Based on the description, it is inferred that the vulnerability can be triggered by supplying a crafted APNG file to any invocation of Image.open(), whether the file comes from a local upload, a network transfer, or embedded user data. Exploitation requires only the malicious file, making it relatively straightforward for an attacker with access to the input processing pipeline.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Pillow to version 13.0.0 or later, which includes the APNG background disposal allocation fix.
  • Validate the declared canvas size of any PNG before invoking Image.open(); reject files whose canvas dimensions exceed acceptable memory limits.
  • Run Pillow image processing in a sandboxed environment with strict memory quotas to contain potential resource exhaustion.

Generated by OpenCVE AI on October 20, 2026 at 06:32 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-5xm2-6676-qcp9 Pillow: APNG background disposal allocates full canvas before decompression bomb check
History
Type Values Removed Values Added
Metrics ssvc

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

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
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 8.1.0 until 13.0.0, Pillow can allocate an APNG disposal background at the full canvas size before applying the decompression-bomb check. A crafted APNG with a small first frame, a very large declared canvas, and background disposal or first-frame OP_PREVIOUS reaches PngImageFile._seek while Image.open() positions frame zero. The full-canvas allocation occurs inside Image.open() without requiring pixel loading or frame iteration. This can exhaust memory and deny service. This issue is fixed in version 13.0.0.
Title Pillow: APNG background disposal allocates full canvas before decompression bomb check
Weaknesses CWE-789
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-770

    Allocation of Resources Without Limits or Throttling

  • CWE-789

    Memory Allocation with Excessive Size Value

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 28, 2026, 3:21 PM
Reserved
Oct 19, 2026, 4:58 PM
Status
Modified
Published
Oct 19, 2026, 10:17 PM
Modified
Oct 28, 2026, 4:17 PM
Severity
Important
Public date
Oct 19, 2026, 9:10 PM