---
id: "CVE-2026-119208"
kind: "vulnerability"
aliases: ["CVE-2026-119208"]
title: "pypdf: forged page count in encrypted PDFs exhausts time and memory"
severity: "high"
cvss: 7.1
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["package", "pypdf", "python"]
not_affected_if: ["no-encrypted-pdfs", "trusted-input-only"]
published_at: "2026-10-29T21:17:20+00:00"
first_seen_at: "2026-10-29T21:26:51+00:00"
updated_at: "2026-10-29T21:28:37+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-119208", "first_seen_at": "2026-10-29T21:26:51+00:00"}]
---

# pypdf: forged page count in encrypted PDFs exhausts time and memory

pypdf is a pure-Python PDF library. Before 6.21.3, reading the page count of a crafted encrypted PDF trusts a forged /Count value, so an attacker can make the application spend excessive time and memory.

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

## How to check

- Check the installed version with `pip show pypdf` and see whether it is below `6.21.3`.
- Search your code and services for calls that read the page count (for example `len(reader.pages)` or `reader.get_num_pages()`) on PDFs uploaded or fetched from outside.

## Fix

- Upgrade pypdf to `6.21.3`.

## Timeline

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

## From the sources

pypdf is a free and open-source pure-python PDF library. Prior to 6.21.3, pypdf can consume excessive time and memory when an application accesses the page count of a crafted encrypted PDF whose page tree declares a forged /Count value. Even after successful decryption, page-count retrieval trusts the unvalidated declared count instead of walking the page tree, allowing the attacker-controlled value to drive excessive work and memory use. This issue is fixed in version 6.21.3.

---

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