CVE-2026-42309: Pillow: Heap buffer overflow with nested list coordinates
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
Event History
Frequently Asked Questions
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.
How do I fix CVE-2026-42309?
To fix CVE-2026-42309, upgrade the Pillow package to version 12.2.0 or higher.
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.
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.
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.