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

Published May 4, 2026
·
Updated

Last updated 8 June 2026

Other sources

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.

GitHub

Pillow is a Python imaging library. From version 11.2.1 to before version 12.2.0, 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 issue has been patched in version 12.2.0.

MITRE

Affected Software

3 affected componentsFixes available
pip/pillow>=11.2.1<12.2.0
12.2.0
Python Pillow>=11.2.1<12.2.0
debian/pillow
8.1.2+dfsg-0.3+deb11u28.1.2+dfsg-0.3+deb11u39.4.0-1.1+deb12u111.1.0-5+deb13u212.2.0-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

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

    Fixed in 12.2.0
  2. Upgrade

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

    Fixed in 8.1.2+dfsg-0.3+deb11u2Fixed in 8.1.2+dfsg-0.3+deb11u3Fixed in 9.4.0-1.1+deb12u1Fixed in 11.1.0-5+deb13u2Fixed in 12.2.0-1
  3. Upgrade

    Upgrade Pillow to a version that resolves this vulnerability.

    Fixed in 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
Jun 9, 2026
Data Sourced
via Ubuntu·03:03 PM
RemedyDescriptionSeverityAffected Software
Data Sourced
via Launchpad·03:05 PM
Description
Data Sourced
via Debian·03:05 PM
DescriptionAffected 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