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 package | Versions | Reported by |
|---|---|---|
| python-pillow Pillow | >= 11.2.1, < 12.2.0 | CVE List |
| pillow (PyPI) | from 11.2.1 before 12.2.0 | GitHub Advisory Database, PyPA Advisory Database |
| python pillow | from 11.2.1 before 12.2.0 | NVD |
| pillow (Bitnami) | from 11.2.1 before 12.2.0 | Bitnami Vulnerability Database |
All scores
| GitHub_M | 5.1medium CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N |
| GitHub | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N |
| NVD | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| PyPA Advisory Database | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| Bitnami Vulnerability Database | medium rating |
Classification
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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-42309 changed 2026-05-11 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-5xmw-vc9v-4wf2 changed 2026-10-19 | CC-BY-4.0 |
| NVD | CVE-2026-42309 changed 2026-07-24 | Public domain |
| PyPA Advisory Database | PYSEC-2026-2251 changed 2026-07-13 | CC-BY-4.0 |
| Bitnami Vulnerability Database | BIT-PILLOW-2026-42309 changed 2026-09-08 | Apache-2.0 |