# CVE-2026-96640: Pillow PDF append accepts malformed shared page-tree DAG causing resource exhaustion

- Severity: High 8.2 (CVSS:4.0, scored by GitHub_M) `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/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.60%, higher than 50% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-10-21T21:03:22.785Z
- Modified: 2026-10-29T10:55:39.916Z
- Also known as: GHSA-mrfp-p49p-3hf2, BIT-PILLOW-2026-96640
- Weaknesses: CWE-400, CWE-407
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: GitHub_M

## Description

Pillow is a Python imaging library. From 5.1.0 until 13.0.0, PdfParser.linearize_page_tree() in src/PIL/PdfParser.py treats a PDF /Pages graph as a tree without tracking duplicate indirect references. When Image.save(..., format="PDF", append=True) processes an attacker-controlled existing PDF whose /Kids arrays repeatedly reference the same child /Pages node, Pillow expands the shared subtree as distinct pages. A compact malformed PDF can therefore create exponentially many page references and consume disproportionate CPU before the append completes. This issue is fixed in version 13.0.0.

(As written by CVE List.)

## Affected

- python-pillow Pillow: >= 5.1.0, < 13.0.0
- pillow (PyPI): from 5.1.0 before 13.0.0
- python pillow: from 5.1.0 before 13.0.0
- pillow (Bitnami): from 5.1.0 before 13.0.0

## Every score

- GitHub_M: CVSS:4.0 8.2 High `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`
- GitHub: CVSS:4.0 High `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Bitnami Vulnerability Database: rating High

## References

- <https://github.com/python-pillow/Pillow/security/advisories/GHSA-mrfp-p49p-3hf2> (exploit, advisory, vendor-advisory, web)
- <https://github.com/python-pillow/Pillow/pull/10093> (issue-tracking, report, web)
- <https://github.com/python-pillow/Pillow/commit/6f0e7ee1f9c2fe227906f8a4b926e6622b702bc7> (fix, patch, web)
- <https://github.com/python-pillow/Pillow/releases/tag/13.0.0> (article, release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-96640> (advisory, web)
- <https://github.com/python-pillow/Pillow> (package)

## Sources

- CVE List: [CVE-2026-96640](https://www.cve.org/CVERecord?id=CVE-2026-96640), CVE Terms of Use, modified 2026-10-28
- GitHub Advisory Database: [GHSA-mrfp-p49p-3hf2](https://github.com/advisories/GHSA-mrfp-p49p-3hf2), CC-BY-4.0, modified 2026-10-29
- NVD: [CVE-2026-96640](https://nvd.nist.gov/vuln/detail/CVE-2026-96640), Public domain, modified 2026-10-28
- Bitnami Vulnerability Database: [BIT-PILLOW-2026-96640](https://osv.dev/vulnerability/BIT-PILLOW-2026-96640), Apache-2.0, modified 2026-10-29

---

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