---
id: "CVE-2026-119204"
kind: "vulnerability"
aliases: ["CVE-2026-119204"]
title: "pypdf: crafted PDF page tree can exhaust memory during parsing"
severity: "high"
cvss: 7.1
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["document-processing", "package", "pypdf", "python"]
not_affected_if: ["pypdf-not-used", "trusted-input-only"]
published_at: "2026-10-29T21:17:19+00:00"
first_seen_at: "2026-10-29T21:26:51+00:00"
updated_at: "2026-10-29T21:28:41+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-119204", "first_seen_at": "2026-10-29T21:26:51+00:00"}]
---

# pypdf: crafted PDF page tree can exhaust memory during parsing

pypdf, a pure-Python PDF library, can use excessive memory when parsing a crafted PDF whose page tree contains many shared resources. An attacker who supplies such a PDF can make the process consume disproportionate memory, which can crash or stall the program that parses it.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed pypdf version with `pip show pypdf` or `python -c "import pypdf; print(pypdf.__version__)"`
- Check pinned versions in `requirements.txt`, `pyproject.toml` or `poetry.lock` for pypdf below `6.21.4`

## Fix

- pypdf: `6.21.4`

## Timeline

- 2026-10-29T21:26:51+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-119204

## From the sources

pypdf is a free and open-source pure-python PDF library. Prior to 6.21.4, pypdf can consume excessive memory while parsing a crafted PDF page tree containing many shared resources. Page-tree flattening copies page dictionary and inherited resource entries without a document-wide entry budget, allowing the crafted resource structure to cause disproportionate allocations. This issue is fixed in version 6.21.4.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
