pypdf Denial-of-Service Vulnerability via XMP Metadata Entity Declarations

Vulnerability

A denial-of-service vulnerability has been identified in the pypdf library, affecting versions prior to 6.10.0. This vulnerability arises from the library's handling of Extensible Metadata Platform (XMP) metadata, where manipulated entity declarations can lead to excessive memory consumption. An attacker can exploit this issue by crafting a PDF that, when processed, causes significant RAM usage due to the parsing of the XMP metadata.

Impact

Exploitation of this vulnerability can lead to large memory usage, causing a denial-of-service condition.

Reproduction

The vulnerability can be reproduced by creating a PDF file that includes XMP metadata with custom entity declarations. This can be done by embedding entities that expand into large amounts of data, such as 'A' repeated multiple times, which the XMP parser will process, leading to increased memory consumption.

Remediation

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

Added: Apr 17, 2026, 1:28 AM
Updated: Apr 17, 2026, 1:28 AM

Vulnerability Rating

Custom Algorithm
spread
5.4
impact
2.5
exploitability
5.7
remediation
7.7
relevance
6.1
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.