CVE-2026-112402: Pillow: Double free in ImagingScaleAffine on calloc failure via Image.transform

Published Oct 19, 2026
·
Updated

Pillow is a Python imaging library. Prior to 13.0.0, Pillow can double free image memory when ImagingScaleAffine encounters a selective allocation failure. The affected fast path handles Transform.EXTENT or pure scale-and-translate Transform.AFFINE operations with the default NEAREST resampling. The output image allocation must succeed while the additional per-column lookup allocation fails, after which the error path deletes image storage that later cleanup releases again. An attacker who can drive such a large Image.transform() operation under memory pressure may trigger the failure. This can crash the process and may corrupt memory. This issue is fixed in version 13.0.0.

Affected Software

1 affected component
pypi/Pillow<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 19, 2026
CVE Published
via MITRE·09:18 PM
Data Sourced
via MITRE·09:18 PM
DescriptionWeakness
Data Sourced
via NVD·10:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are most likely to be exposed?

Deployments using Pillow before 13.0.0 that process attacker-controlled images or allow attackers to influence Image.transform() parameters are the relevant exposure cases. Exploitation specifically requires a large transform to run while the process is under memory pressure.

2

What transform settings reach the affected code path?

The affected fast path is used for Transform.EXTENT and for pure scale-and-translate Transform.AFFINE operations when using the default NEAREST resampling. Other transform types or resampling settings are not identified as affected by the provided information.

3

Does exploitation require authentication or user interaction?

The CVSS vector indicates no privileges and no user interaction are required. An attacker must nevertheless be able to cause the application to perform a qualifying large Image.transform() operation and induce the required selective allocation failure.

4

What can be done if upgrading is not immediately possible?

Avoid or restrict large Image.transform() operations using Transform.EXTENT or pure scale-and-translate Transform.AFFINE with NEAREST resampling, especially for attacker-influenced inputs. Reducing memory pressure can also reduce the specific allocation-failure condition required for the bug.

5

How can I determine whether an application is affected?

Check whether it uses Pillow versions earlier than 13.0.0 and invokes Image.transform() with the affected transform and resampling conditions. Affected executions require the output image allocation to succeed while the additional per-column lookup allocation fails.

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