PyPI: pypdf

CVE-2026-22691

Safety vulnerability ID: SFTY-20260109-47444

Safety legacy ID: pyup.io-84345

Affected versions of the pypdf package are vulnerable to Denial of Service (DoS) due to inefficient cross-reference table rebuilding when handling malformed startxref data in non-strict mode. In pypdf._reader.PdfReader._rebuild_xref_table(), the non-strict recovery path scans the entire PDF buffer with a re.finditer() pattern to rediscover obj markers, which can take excessively long on inputs dominated by whitespace.

Created at: Jan 22, 2026Updated at: Jan 22, 2026

Overview

pypdf has possible long runtimes for malformed startxref

Advisory

Affected versions of the pypdf package are vulnerable to Denial of Service (DoS) due to inefficient cross-reference table rebuilding when handling malformed startxref data in non-strict mode. In pypdf._reader.PdfReader._rebuild_xref_table(), the non-strict recovery path scans the entire PDF buffer with a re.finditer() pattern to rediscover obj markers, which can take excessively long on inputs dominated by whitespace.

Affected Package

Affecting pypdf package, versions
<6.6.0

Also affects

---

How to Fix

Upgrade
pypdf
to
6.6.0
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more