CVE-2026-42309
JSON

5.1medium

Pillow: Heap buffer overflow with nested list coordinates

Severity
5.1medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.13% (higher than 3% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-5xmw-vc9v-4wf2BIT-PILLOW-2026-42309PYSEC-2026-2251

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.

Affected

Product or packageVersionsReported by
python-pillow Pillow>= 11.2.1, < 12.2.0CVE List
pillow (PyPI)from 11.2.1 before 12.2.0GitHub Advisory Database, PyPA Advisory Database
python pillowfrom 11.2.1 before 12.2.0NVD
pillow (Bitnami)from 11.2.1 before 12.2.0Bitnami Vulnerability Database

All scores

GitHub_M5.1medium CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
GitHub5.5medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
GitHubmedium CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
NVD5.5medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
PyPA Advisory Database5.5medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Bitnami Vulnerability Databasemedium rating

Classification

CWE-122

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database

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.

NVD (es)

Pillow es una biblioteca de imágenes de Python. Desde la versión 11.2.1 hasta antes de la versión 12.2.0, pasar listas anidadas como coordenadas a APIs que aceptan coordenadas, como ImagePath.Path, ImageDraw.ImageDraw.polygon e ImageDraw.ImageDraw.line, podría causar un desbordamiento de búfer de montón, ya que las listas anidadas se desempaquetaban recursivamente más allá del búfer asignado. Las listas de coordenadas ahora se validan para que contengan exactamente dos coordenadas numéricas. Este problema ha sido parcheado en la versión 12.2.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-42309 changed 2026-05-11CVE Terms of Use
GitHub Advisory DatabaseGHSA-5xmw-vc9v-4wf2 changed 2026-10-19CC-BY-4.0
NVDCVE-2026-42309 changed 2026-07-24Public domain
PyPA Advisory DatabasePYSEC-2026-2251 changed 2026-07-13CC-BY-4.0
Bitnami Vulnerability DatabaseBIT-PILLOW-2026-42309 changed 2026-09-08Apache-2.0