CVE-2026-112891: Pillow: Quadratic GIF comment copying during save

Published Oct 19, 2026
·
Updated

On Pillow 12.3.0 and upstream main (ad277e2761b489681e71b51e91367d46b0ceabb9), a GIF with a long comment makes getglobalheader() copy portions of the comment repeatedly when saving, including comments carried over from untrusted images. I suggest provisional Moderate severity for crafted-image CPU denial of service, with CVSS-B 6.9 assuming a network service automatically opens unauthenticated uploads and they are resaved as GIFs; impact depends on input-size, concurrency, and worker CPU limits.

Other sources

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. getglobalheader() 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.

— MITRE

Affected Software

10 affected componentsFixes available
pypi/Pillow>=9.2.0<13.0.0
pip/pillow>=9.2.0<13.0.0
13.0.0
Python Pillow>=9.2.0<13.0.0
bitnami/pillow>=9.2.0<13.0.0
13.0.0
ubuntu/pillow-python2*
ubuntu/pillow*
ubuntu/pillow*
ubuntu/pillow*
IBM App Connect Operator<=CD: 12.1.0 - 12.21.0 12.0 LTS: 12.0.0 - 12.0.28 13 LTS: 13.0.0 - 13.6.0
IBM App Connect EnterpriseCertified Containers Operands<=CD: 12.0.11.1-r1 - 12.0.12.5-r1, 13.0.1.0-r1 - 13.0.6.2-r1 12.0 LTS: 12.0.12-r1 - 12.0.12-r28 13 LTS: 13.0.7.0-r1 - 13.0.9.0-r1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/pillow to a version that resolves this vulnerability.

    Fixed in 13.0.0
  2. Upgrade

    Upgrade bitnami/pillow to a version that resolves this vulnerability.

    Fixed in 13.0.0
  3. Upgrade

    Upgrade Pillow to a version that resolves this vulnerability.

    Fixed in 13.0.0

Event History

Oct 19, 2026
CVE Published
via MITRE·09:33 PM
Data Sourced
via MITRE·09:33 PM
DescriptionWeakness
Data Sourced
via OSV·09:33 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:17 PM
RemedyDescriptionSeverityWeaknessAffected Software
Oct 21, 2026
Advisory Published
via GitHub·08:38 PM
Data Sourced
via GitHub·08:38 PM
DescriptionWeaknessAffected Software
Oct 26, 2026
Advisory Published
via OSV·05:55 AM
Nov 4, 2026
Data Sourced
via OSV·08:03 PM
Affected Software
Nov 9, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

Which applications are exposed to this issue?

Applications using Pillow versions 9.2.0 through versions before 13.0.0 are exposed if they accept GIF images from untrusted sources and save or re-save them as GIF files. The risk is tied to processing images that contain large GIF comments.

2

What must an attacker do to trigger the denial of service?

An attacker must provide a GIF containing a large comment to an application that later saves the image as a GIF. During GIF header construction, Pillow repeatedly copies comment data, causing excessive CPU consumption.

3

Is authentication or user interaction required?

No. The supplied CVSS vector indicates network reachability with low attack complexity, no privileges required, and no user interaction required; however, the application must process and save the attacker-controlled GIF as GIF.

4

What is the remediation?

Upgrade Pillow to version 13.0.0, which fixes the issue. If upgrading is not immediately possible, avoid saving untrusted GIF inputs as GIF files, particularly inputs that may retain embedded comments.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203