CVE-2026-42309: Pillow: Heap buffer overflow with nested list coordinates

Published May 4, 2026
·
Updated

Passing nested lists as coordinates to APIs that accept coordinates such as `ImagePath.Path`, `ImageDraw.ImageDraw.polygon` and `ImageDraw.ImageDraw.line` could cause a heap buffer overflow, as nested lists were recursively unpacked beyond the allocated buffer. Coordinate lists are now validated to contain exactly two numeric coordinates. This was introduced in Pillow 11.2.1.

Affected Software

2 affected componentsFixes available
pip/pillow>=11.2.1<12.2.0
12.2.0
Python Pillow>=11.2.1<12.2.0

Event History

May 4, 2026
Advisory Published
via GitHub·08:18 PM
Data Sourced
via GitHub·08:18 PM
DescriptionWeaknessAffected Software
May 9, 2026
CVE Published
via MITRE·04:08 AM
Data Sourced
via MITRE·04:08 AM
DescriptionWeakness
Data Sourced
via NVD·06:16 AM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-42309?

CVE-2026-42309 is rated as a high severity vulnerability due to its potential to cause a heap buffer overflow.

2

How do I fix CVE-2026-42309?

To fix CVE-2026-42309, upgrade the Pillow package to version 12.2.0 or higher.

3

What software is affected by CVE-2026-42309?

CVE-2026-42309 affects versions of the Pillow library between 11.2.1 and 12.2.0.

4

What are the potential consequences of exploiting CVE-2026-42309?

Exploitation of CVE-2026-42309 could lead to arbitrary code execution due to a heap buffer overflow.

5

How can I avoid triggering CVE-2026-42309?

To avoid triggering CVE-2026-42309, ensure that nested lists used as coordinates are properly validated before passing them to the Pillow APIs.

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