CVE-2026-112396: Pillow: Heap use-after-free when encoding TIFF to an in-memory buffer

Published Oct 19, 2026
·
Updated

Pillow is a Python imaging library. From 11.3.0 until 13.0.0, Pillow has a heap use-after-free when libtiff rejects a tag while encoding TIFF data to an in-memory buffer. When an application saves attacker-influenced TIFF tags to BytesIO, libtiff can reject a tag during encoding in ImagingLibTiffEncode; the error path then frees the output buffer without closing or clearing the TIFF handle, and later cleanup flushes through the write callback into freed memory, which can crash the process and may enable code execution. This issue is fixed in version 13.0.0.

Affected Software

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

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Applications using Pillow versions from 11.3.0 up to, but not including, 13.0.0 are affected when they encode TIFF data to an in-memory BytesIO buffer with attacker-influenced TIFF tags.

2

What must an attacker be able to control to trigger the flaw?

The attacker needs to influence TIFF tag data supplied to an application’s TIFF-saving operation. The vulnerable path requires libtiff to reject a tag during encoding to BytesIO.

3

What is the impact if exploitation succeeds?

The use-after-free can crash the affected process. The advisory also states that it may enable code execution.

4

What version remediates the issue?

Upgrade Pillow to version 13.0.0, which 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