CVE-2026-96643: Pillow: PNG eXIf chunk makes EXIF parsing run in quadratic time

Published Oct 21, 2026
·
Updated

Pillow is a Python imaging library. From 11.0.0 until 13.0.0, Exif.load() in src/PIL/Image.py repeatedly slices the remaining EXIF data while it begins with the six-byte Exif header. src/PIL/PngImagePlugin.py accepts an uncapped PNG eXIf chunk, so a file filled with repeated headers causes a new shrinking copy on every iteration and quadratic CPU work. The condition is reachable through Image.getexif(), Image.getexif(), and ImageOps.exiftranspose(), including common photo-upload rotation workflows. This issue is fixed in version 13.0.0.

Affected Software

1 affected component
pypi/Pillow>=11.0.0<13.0.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Pillow to a version that resolves this vulnerability.

    Fixed in 13.0.0

Event History

Oct 21, 2026
CVE Published
via MITRE·08:56 PM
Data Sourced
via MITRE·08:56 PM
DescriptionWeakness

Frequently Asked Questions

1

Which deployments are realistically exposed to this issue?

Deployments using Pillow versions 11.0.0 through versions before 13.0.0 are exposed when they process attacker-controlled PNG files and invoke EXIF handling. Common exposure includes photo-upload workflows that use ImageOps.exif_transpose() for automatic rotation.

2

What does an attacker need to provide to trigger the problem?

An attacker needs to supply a PNG containing an eXIf chunk filled with repeated six-byte Exif headers. The application must then reach EXIF parsing through Image.getexif(), Image._getexif(), or ImageOps.exif_transpose().

3

What should be done if an immediate upgrade is not possible?

Avoid invoking the affected EXIF-processing paths on untrusted PNG uploads, particularly automatic EXIF-based rotation via ImageOps.exif_transpose(). Restricting or rejecting PNG inputs with eXIf metadata can also prevent the described trigger condition.

4

How can I determine whether my application is affected?

Check whether Pillow is installed at version 11.0.0 or later but earlier than 13.0.0, and whether your code calls Image.getexif(), Image._getexif(), or ImageOps.exif_transpose() on PNG files from untrusted sources. Pillow 13.0.0 contains the fix.

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