CVE-2026-112891

Pillow: Quadratic GIF comment copying during save

Published Oct 19, 2026 CVSS 4.0 · 6.9 Medium EPSS < 1% KEV · Not listed
Description
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. _get_global_header() 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.

Analysis

AI-generated

Technical impact

Pillow, the Python imaging library, performs quadratic copying of GIF comment data while assembling the global header in its save routine. From version 9.2.0 through 12.x, an attacker can craft a GIF with an unusually large comment. The library then repeatedly copies portions of this comment, causing the CPU workload to grow quadratically with the comment size. This unnecessary computation can severely degrade or halt an application that processes user supplied images, making the weakness a classic denial‑of‑service flaw identified as CWE‑407.

Affected Systems

The vulnerability affects the Pillow library bundled with the python‑pillow package. Any Python environment that imports Pillow and processes image files for users is potentially exposed on versions 9.2.0 up to but not including 13.0.0; the issue was resolved in Pillow 13.0.0. Applications that perform a resize, filter, or otherwise trigger a call to Pillow’s GIF save path are at risk if they accept untrusted image uploads.

Risk and Exploitability

The CVSS score of 6.9 indicates moderate severity, and the EPSS score of < 1% indicates a low likelihood of exploitation. The vulnerability is not listed in the CISA KEV catalog. An attacker can exploit the weakness by submitting a GIF image with a massive comment field to an application that will use Pillow to save or re‑encode the file. The resulting quadratic copy operation can monopolise CPU resources, potentially delaying or denying service for other requests.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Pillow to 13.0.0 or newer.
  • Reject or truncate GIF comment fields that exceed a safe size threshold before calling Pillow’s save function.
  • Apply request throttling or CPU usage limits on endpoints that process images to contain any impact from a denial‑of‑service attack.

Generated by OpenCVE AI on October 22, 2026 at 20:46 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-fc9g-5qg7-mf45 Pillow: Quadratic GIF comment copying during save
History
Type Values Removed Values Added
First Time appeared Python
Python pillow
CPEs cpe:2.3:a:python:pillow:*:*:*:*:*:*:*:*
Vendors & Products Python
Python pillow
Metrics cvssV3_1

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

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'}

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

None

cvssV3_1

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

threat_severity

Moderate

Type Values Removed Values Added
Metrics ssvc

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

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 9.2.0 until 13.0.0, Pillow performs quadratic copying when saving a GIF with a long comment. _get_global_header() 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.
Title Pillow: Quadratic GIF comment copying during save
Weaknesses CWE-407
References
Metrics cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/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, 1:54 PM
Reserved
Oct 19, 2026, 8:16 PM
Status
Analyzed
Published
Oct 19, 2026, 10:17 PM
Modified
Oct 27, 2026, 2:59 PM
Severity
Moderate
Public date
Oct 19, 2026, 9:33 PM