BREACHSPIDER
CVE databaseVendorsIntelFeaturesDevelopersDocsPricingSign inStart free trial

CVE-2026-42309 in Python Pillow

Medium 5.5

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 t...

Affects 1 product from 1 vendor. Facts below cite their sources.

CVSS 3.15.5
CVSS v45.1
EPSS0.2%
EPSS percentile5th
FixUnknown

Requires local access, low complexity, low privileges required, no user interaction needed, impact contained to the vulnerable component, no confidentiality impact, no integrity impact, full availability impact.

Affected products and versions

VendorProductAffected versions
Python Pillow ≥ 11.2.1, < 12.2.0

A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.

Fix and vendor advisory

No official vendor advisory link on record. See the CVE record.

Vendor PSIRT: [email protected]

Exploitation

CISA known-exploitedNot in the CISA KEV catalog
Public exploitNot confirmed

Official 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.

Source: NIST NVD / MITRE CVE.

Record details

CVE IDCVE-2026-42309
BreachSpider IDBS-2026-GLOBAL-270264-M
CVSS vectorCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Published2026-05-09
Last modified2026-07-24
Weakness (CWE)
SourceNVD

Weakness definitions

CWE-122: Heap-Based Buffer Overflow

Buffer overflow corrupting dynamically allocated heap memory, exploitable for arbitrary code execution.

Related attack patterns (CAPEC)

CAPEC-92 Forced Integer Overflow via CWE-122

Mapping is CWE to CAPEC per MITRE CAPEC 3.9.

Analysis AI-written, not human-reviewed

A heap buffer overflow vulnerability exists in Pillow versions 11.2.1 to 12.1.9 due to improper validation of nested lists passed as coordinates to certain APIs. This could allow an attacker to execute arbitrary code with the privileges of the process running Pillow.

The vulnerability is triggered by passing nested lists as coordinates to APIs such as ImagePath.Path, ImageDraw.ImageDraw.polygon, and ImageDraw.ImageDraw.line. The nested lists are recursively unpacked, leading to a heap buffer overflow if the recursion exceeds the allocated buffer size.

Questions

What is CVE-2026-42309?

A heap buffer overflow vulnerability exists in Pillow versions 11.2.1 to 12.1.9 due to improper validation of nested lists passed as coordinates to certain APIs. This could allow an attacker to execute arbitrary code with the privileges of the process running Pillow.

What is the CVSS score for CVE-2026-42309?

CVE-2026-42309 has CVSS 5.5 (Medium). Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H. EPSS: 0.2%.

Is CVE-2026-42309 actively exploited?

No confirmed active exploitation of CVE-2026-42309 as of 2026-07-25.

How do I remediate CVE-2026-42309?

Priority: HIGH. PSIRT: [email protected]

What systems are affected by CVE-2026-42309?

CVE-2026-42309 affects Python Pillow.

For developers and AI agents

Run this check from your own code or agent

REST API

curl -s https://breachspider.com/api/v1/assets/correlate-cves \
 -H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"assets":[{"asset_id":"dev-1","vendor":"Python","product":"Pillow","version":"1.0"}]}'

API reference

Python SDK

pip install breachspider

PyPI · GitHub

MCP for AI agents

# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp

Setup for Claude, ChatGPT, Cursor

Free trial: 14 days, 750 device checks, no card.

Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-07-24.