---
id: "CVE-2026-119207"
kind: "vulnerability"
aliases: ["CVE-2026-119207"]
title: "pypdf: crafted PDF dictionary exhausts memory in strict mode"
severity: "high"
cvss: 7.1
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["package", "pypdf", "python"]
not_affected_if: ["pypdf-6.21.3-or-later", "strict-mode-off", "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:38+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-119207", "first_seen_at": "2026-10-29T21:26:51+00:00"}]
---

# pypdf: crafted PDF dictionary exhausts memory in strict mode

pypdf, a pure-Python PDF library, can consume excessive memory when strict mode parses a crafted invalid PDF dictionary. Nested parsing failures repeat exception text, so a small malformed file can produce very large error messages and exhaust memory.

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

## How to check

- `pip show pypdf` or `python -c "import pypdf; print(pypdf.__version__)"` to read the installed version
- Check requirements files and lockfiles for pypdf pinned below `6.21.3`
- Check whether the code calls pypdf with strict mode enabled (`strict=True`) on untrusted PDFs

## Fix

- pypdf: move to `6.21.3` or later

## Timeline

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

## From the sources

pypdf is a free and open-source pure-python PDF library. Prior to 6.21.3, pypdf can consume excessive memory when strict mode loads a crafted invalid PDF dictionary. Nested parsing failures add repeated exception text to newly raised errors, allowing a small malformed dictionary to amplify into very large error messages. 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_
