CVE-2026-40260

pypdf: Manipulated XMP metadata entity declarations can exhaust RAM

Published Apr 16, 2026 CVSS 4.0 · 6.9 Medium EPSS < 1% KEV · Not listed
Description
pypdf is a free and open-source pure-python PDF library. In versions prior to 6.10.0, manipulated XMP metadata entity declarations can exhaust RAM. An attacker who exploits this vulnerability can craft a PDF which leads to large memory usage. This requires parsing the XMP metadata. This issue has been fixed in version 6.10.0.

Analysis

AI-generated

Technical impact

Manipulated XMP metadata entity declarations in the pypdf library cause the PDF parsing process to allocate large amounts of memory, leading to resource exhaustion. The vulnerability is an instance of improper resource management (CWE-776) and can produce a denial‑of‑service condition if an attacker feeds a malicious PDF file to a system that imports it with this library.

Affected Systems

The vulnerability affects all installations of the py-pdf:pypdf library with a version prior to 6.10.0. Any system that processes PDF documents using this library is potentially exposed.

Risk and Exploitability

The CVSS score of 6.9 indicates moderate severity. No EPSS score is available, and the issue is not listed in the CISA KEV catalog. The attack requires only the ability to supply a corrupted PDF to the application; thus, services that accept user‑supplied PDF files or libraries that process PDFs on the internet are the most likely vectors. If exploited, the victim may experience high memory consumption and possible crash or suspension of the process, impacting availability of the application.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to pypdf version 6.10.0 or later as the vulnerability has been fixed.
  • If a library upgrade cannot be performed immediately, run PDF parsing in a sandboxed or isolated process and enforce strict memory limits to contain potential exhaustion.
  • Pre‑validate or sanitize PDFs to limit XMP metadata complexity before delegating to pypdf, rejecting documents that exceed reasonable size thresholds.

Generated by OpenCVE AI on April 17, 2026 at 02:21 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-3crg-w4f6-42mx pypdf: Manipulated XMP metadata entity declarations can exhaust RAM
History
Type Values Removed Values Added
CPEs cpe:2.3:a:pypdf_project:pypdf:*:*:*:*:*:*:*:* cpe:2.3:a:py-pdf:pypdf:*:*:*:*:*:*:*:*
Vendors & Products Pypdf Project
Pypdf Project pypdf
Type Values Removed Values Added
First Time appeared Pypdf Project
Pypdf Project pypdf
CPEs cpe:2.3:a:pypdf_project:pypdf:*:*:*:*:*:*:*:*
Vendors & Products Pypdf Project
Pypdf Project pypdf
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L'}

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Py-pdf
Py-pdf pypdf
Vendors & Products Py-pdf
Py-pdf pypdf
Type Values Removed Values Added
Description pypdf is a free and open-source pure-python PDF library. In versions prior to 6.10.0, manipulated XMP metadata entity declarations can exhaust RAM. An attacker who exploits this vulnerability can craft a PDF which leads to large memory usage. This requires parsing the XMP metadata. This issue has been fixed in version 6.10.0.
Title pypdf: Manipulated XMP metadata entity declarations can exhaust RAM
Weaknesses CWE-776
References
Metrics cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-776

    Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Apr 17, 2026, 6:42 PM
Reserved
Apr 10, 2026, 5:31 PM
Status
Analyzed
Published
Apr 17, 2026, 1:17 AM
Modified
Nov 2, 2026, 4:06 PM