CVE-2026-42309: CWE-122: Heap-based Buffer Overflow in python-pillow Pillow
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.
AI Analysis
Technical Summary
The Pillow Python imaging library versions >= 11.2.1 and < 12.2.0 are vulnerable to a heap-based buffer overflow (CWE-122) when nested lists are passed as coordinates to APIs that accept coordinate inputs such as ImagePath.Path, ImageDraw.ImageDraw.polygon, and ImageDraw.ImageDraw.line. The vulnerability arises because nested lists are recursively unpacked beyond the allocated buffer size, leading to memory corruption. This flaw has been fixed in version 12.2.0 by enforcing validation that coordinate lists contain exactly two numeric values.
Potential Impact
Exploitation of this vulnerability could lead to memory corruption due to heap buffer overflow, potentially causing application crashes or other undefined behavior. The CVSS 4.0 base score is 5.1 (medium severity), indicating a moderate impact. There are no known exploits in the wild at this time.
Mitigation Recommendations
This vulnerability is patched in Pillow version 12.2.0. Users should upgrade to version 12.2.0 or later to remediate this issue. Since this is a library vulnerability, updating the dependency in your environment is the recommended action. Patch status is confirmed by the vendor's versioning and description.
CVE-2026-42309: CWE-122: Heap-based Buffer Overflow in python-pillow Pillow
Description
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.
CVSS v4.0
Score 5.1medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The Pillow Python imaging library versions >= 11.2.1 and < 12.2.0 are vulnerable to a heap-based buffer overflow (CWE-122) when nested lists are passed as coordinates to APIs that accept coordinate inputs such as ImagePath.Path, ImageDraw.ImageDraw.polygon, and ImageDraw.ImageDraw.line. The vulnerability arises because nested lists are recursively unpacked beyond the allocated buffer size, leading to memory corruption. This flaw has been fixed in version 12.2.0 by enforcing validation that coordinate lists contain exactly two numeric values.
Potential Impact
Exploitation of this vulnerability could lead to memory corruption due to heap buffer overflow, potentially causing application crashes or other undefined behavior. The CVSS 4.0 base score is 5.1 (medium severity), indicating a moderate impact. There are no known exploits in the wild at this time.
Mitigation Recommendations
This vulnerability is patched in Pillow version 12.2.0. Users should upgrade to version 12.2.0 or later to remediate this issue. Since this is a library vulnerability, updating the dependency in your environment is the recommended action. Patch status is confirmed by the vendor's versioning and description.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-04-26T12:37:18.169Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 69fec4aacbff5d8610c504fc
Added to database: 05/09/2026, 05:22:50 UTC
Last enriched: 05/16/2026, 10:55:29 UTC
Last updated: 07/31/2026, 19:22:58 UTC
Views: 144
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.