pypdf Memory Consumption Vulnerability Due to Large /ToUnicode Stream Parsing

Vulnerability

A vulnerability in pypdf, a pure-Python PDF library, prior to version 6.7.1, allows an attacker to create a PDF that causes excessive memory usage and prolonged processing times. This issue arises from parsing the /ToUnicode entry of a font that contains abnormally large values, particularly during text extraction. The vulnerability has been addressed in version 6.7.1.

Impact

Exploitation of this vulnerability leads to significant memory consumption and increased processing times when handling affected PDF files.

Reproduction

The vulnerability can be reproduced by creating a PDF file that includes a font with a /ToUnicode entry containing large values. When this PDF is processed with a version of pypdf prior to 6.7.1, the library will experience extended runtimes and excessive memory usage.

Remediation

Users can upgrade to pypdf version 6.7.1 or later to address this vulnerability. If an immediate upgrade is not possible, the changes from PR #3646 can be applied as a temporary workaround.

Added: Feb 20, 2026, 10:32 PM
Updated: Feb 20, 2026, 10:32 PM

Vulnerability Rating

Custom Algorithm
spread
5.4
impact
2.5
exploitability
5.0
remediation
7.7
relevance
3.2
threat
4.8
urgency
2.9
incentive
0.0

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