# CVE-2026-42309: Pillow: Heap buffer overflow with nested list coordinates

- Severity: Medium 5.1 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.13%, higher than 3% of CVEs (2026-12-01)
- Published: 2026-05-04T20:18:27.000Z
- Modified: 2026-10-19T20:00:04.709Z
- Also known as: GHSA-5xmw-vc9v-4wf2, BIT-PILLOW-2026-42309, PYSEC-2026-2251
- Weaknesses: CWE-122
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- python-pillow Pillow: >= 11.2.1, < 12.2.0
- pillow (PyPI): from 11.2.1 before 12.2.0
- python pillow: from 11.2.1 before 12.2.0
- pillow (Bitnami): from 11.2.1 before 12.2.0

## Every score

- GitHub_M: CVSS:4.0 5.1 Medium `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: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:4.0 Medium `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: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- PyPA Advisory Database: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://github.com/python-pillow/Pillow/security/advisories/GHSA-5xmw-vc9v-4wf2> (advisory, vendor-advisory, web)
- <https://github.com/python-pillow/Pillow/releases/tag/12.2.0> (advisory, article, product, release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-42309> (advisory, web)
- <https://github.com/designcomputer/mysql_mcp_server/commit/a96549f4a4d65443fd6e9c7f2324fba9a5c80a82> (web)
- <https://github.com/python-pillow/Pillow/commit/cf6de8ca9b23e714aa5310e1c791eda66fc0b670> (web)
- <https://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2026-2251.yaml> (web)
- <https://github.com/python-pillow/Pillow> (package)

## Sources

- CVE List: [CVE-2026-42309](https://www.cve.org/CVERecord?id=CVE-2026-42309), CVE Terms of Use, modified 2026-05-11
- GitHub Advisory Database: [GHSA-5xmw-vc9v-4wf2](https://github.com/advisories/GHSA-5xmw-vc9v-4wf2), CC-BY-4.0, modified 2026-10-19
- NVD: [CVE-2026-42309](https://nvd.nist.gov/vuln/detail/CVE-2026-42309), Public domain, modified 2026-07-24
- PyPA Advisory Database: [PYSEC-2026-2251](https://osv.dev/vulnerability/PYSEC-2026-2251), CC-BY-4.0, modified 2026-07-13
- Bitnami Vulnerability Database: [BIT-PILLOW-2026-42309](https://osv.dev/vulnerability/BIT-PILLOW-2026-42309), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2026-42309 · Whole record: https://cve.day/CVE-2026-42309.json · Rebuilt by cve.day 2026-11-25T22:59:21.140Z
