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.
Published: 2026-10-19
Score: 6.9 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Denial of Service
Action: Patch
AI Analysis

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.

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

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

Tue, 27 Oct 2026 15:15:00 +0000

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


Wed, 21 Oct 2026 00:30:00 +0000

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


Tue, 20 Oct 2026 14:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Mon, 19 Oct 2026 22:45:00 +0000

Type Values Removed Values Added
First Time appeared Python-pillow
Python-pillow pillow
Vendors & Products Python-pillow
Python-pillow pillow

Mon, 19 Oct 2026 21:45:00 +0000

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


Subscriptions

Python Pillow
Python-pillow Pillow
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-20T13:54:10.370Z

Reserved: 2026-10-19T20:16:09.856Z

Link: CVE-2026-112891

cve-icon Vulnrichment

Updated: 2026-10-20T13:54:03.713Z

cve-icon NVD

Status : Analyzed

Published: 2026-10-19T22:17:08.640

Modified: 2026-10-27T14:59:43.613

Link: CVE-2026-112891

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-10-19T21:33:32Z

Links: CVE-2026-112891 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-22T21:00:08Z

Weaknesses
  • CWE-407

    Inefficient Algorithmic Complexity

  • CWE-770

    Allocation of Resources Without Limits or Throttling