pypdf Missing Root Object Handling Vulnerability Leading to Denial-of-Service

Vulnerability

A denial-of-service vulnerability has been identified in pypdf, a pure-Python PDF library, affecting versions prior to 6.6.0. The issue arises in non-strict reading mode when a PDF file omits the /Root entry in the trailer but includes a large /Size value. This combination can cause the library to process the file for an extended period, effectively creating a performance issue with invalid files.

Impact

Exploitation of this vulnerability can lead to significantly prolonged processing times for PDF files, causing potential application performance degradation or unresponsiveness.

Reproduction

To reproduce this vulnerability, create a PDF file that lacks a /Root entry in the trailer but has a large /Size value. Then, open this file with pypdf in non-strict mode, which is the default setting. The absence of the /Root entry will cause the PdfReader to search for the Root object by accessing each object number up to the limit defined by the /Size value. If the /Size value is large, this can lead to excessive processing times.

Remediation

Users can upgrade to pypdf version 6.6.0 or later, or switch to strict mode when using the PdfReader. For PdfWriter, an explicit strict reader can be used.

Added: Jan 10, 2026, 5:19 AM
Updated: Jan 10, 2026, 5:19 AM

Vulnerability Rating

Custom Algorithm
spread
5.4
impact
2.5
exploitability
5.3
remediation
8.3
relevance
2.0
threat
4.8
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.