Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconCraft PDF with oversized or element-dense XMP metadata
-
DeliveryDeliver PDF to target application accepting PDF input
-
ExploitApplication invokes pypdf to parse PDF
-
Installpypdf XMP parser allocates unbounded memory for XML processing
-
C2System memory exhausted
-
ExecuteProcess crash or OOM kill
-
ImpactDenial of service achieved
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource allocation limits
MITRE ATT&CK
1 technique across 1 tactic: Impact The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires three concrete conditions: (1) the target application must use a pypdf version prior to 6.12.1; (2) the processed PDF must contain XMP metadata - applications that encounter PDFs without XMP blocks, or that skip XMP parsing, are not affected; and (3) the attacker must be able to supply a PDF file to the vulnerable parsing code path, either directly (local file access) or indirectly (via an upload endpoint, email attachment processor, or similar). No authentication is required from the attacker per CVSS PR:N. Exploitation is limited to availability impact only - no data exfiltration or code execution is possible through this vulnerability. The attack does not require any non-default configuration of pypdf itself, as XMP parsing is standard library behavior triggered by the presence of XMP metadata in a PDF. |
| Impact | The CVSS 4.0 score of 6.9 reflects local attack vector (AV:L), low complexity (AC:L), no privilege requirement (PR:N), no user interaction (UI:N), and high availability impact (VA:H) with zero confidentiality or integrity impact - a targeted denial-of-service profile. The local attack vector is characteristic of file-based library vulnerabilities: the attacker does not directly reach a network socket but instead supplies a crafted file that a local or server-side process parses. Critically, any server-side PDF processing pipeline that accepts untrusted uploads effectively converts this to a remote DoS from the attacker's perspective, elevating practical risk beyond the raw AV:L designation. No EPSS score was included in the input data, preventing probabilistic exploitation likelihood assessment. KEV status is absent, meaning no confirmed active exploitation has been reported to CISA. The attack is not automatable in the SSVC sense unless paired with an upload endpoint. Overall assessment: moderate priority for document-processing services accepting untrusted PDFs; lower priority for offline tooling or controlled-input environments. |
| Exploit ScenarioDerived | An attacker crafts a PDF file containing an XMP metadata stream either exceeding 5 MB in raw byte size or embedding over 100,000 XML elements - construction is trivial and directly derivable from the public test cases added in the patch PR at https://github.com/py-pdf/pypdf/pull/3796. The crafted PDF is submitted to a document ingestion service, file conversion tool, or any web application that parses uploaded PDFs using a vulnerable version of pypdf, causing the parsing process to allocate memory proportional to the XMP payload until the system runs out of memory or the process is killed, resulting in service disruption. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 28, 2026
Memory exhaustion in pypdf's XMP metadata parser allows denial of service via specially crafted PDF files containing oversized or element-dense XMP blocks, affecting all versions prior to 6.12.1. The vulnerability stems from an absence of input limits in the XML-based XMP parsing subsystem (CWE-770), meaning processing a malicious PDF can consume unbounded system memory. No public exploit code has been identified at time of analysis, and no confirmed active exploitation exists; however, the patch diff is publicly visible on GitHub, making trivial exploit construction feasible.
RemediationAI
Upgrade pypdf to version 6.12.1 or later, the confirmed vendor-released patch available at https://github.com/py-pdf/pypdf/releases/tag/6.12.1. Version 6.12.1 introduces configurable hard limits of 5 MB on XMP stream size (XMP_MAX_INPUT_LENGTH) and 100,000 on XML element count (XMP_MAX_ELEMENT_COUNT); these constants are exposed as module-level attributes in pypdf.xmp and can be tuned downward if stricter limits are warranted. If an immediate upgrade is blocked, a compensating control is to enforce a file size or metadata size ceiling in the application layer before invoking pypdf - for example, rejecting PDFs whose raw file size exceeds a defined threshold, or stripping XMP metadata using a separate tool prior to parsing. Note that stripping XMP data may affect downstream metadata-dependent workflows. Another option is to wrap pypdf XMP parsing calls in a subprocess with memory limits enforced by the OS (e.g., ulimit -v on Linux), which bounds the blast radius to the subprocess rather than the main application - at the cost of added latency and complexity.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
pypdf is a widely-used pure-Python PDF library (CPE: cpe:2.3:a:py-pdf:pypdf:*:*:*:*:*:*:*:*) that implements XMP (Extensible Metadata Platform) metadata parsing via a custom XML parser class (_XmpBuilder) derived from Python's ExpatBuilderNS in pypdf/xmp.py. Prior to 6.12.1, this parser imposed no constraints on either the byte length of the XMP data stream or the count of XML elements processed during parsing - a textbook instance of CWE-770 (Allocation of Resources Without Limits or Throttling). An attacker embedding a multi-megabyte XMP block or crafting one with hundreds of thousands of XML elements causes the Python process to allocate memory proportional to the input size with no ceiling. The fix introduces two tunable constants: XMP_MAX_INPUT_LENGTH (defaulting to 5,000,000 bytes) and XMP_MAX_ELEMENT_COUNT (defaulting to 100,000), enforced by raising a LimitReachedError early in parsing. The element limit is enforced via a custom start_element_handler hook on the Expat parser, and the stream length check gates parsing before any XML processing begins.
Know when Pypdf gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
3DescriptionCVE.org
pypdf is a free and open-source pure-python PDF library. Prior to 6.12.1, an attacker who uses this vulnerability can craft a PDF which leads to large memory usage. This requires parsing large XMP metadata, possibly with lots of unnecessary elements. This vulnerability is fixed in 6.12.1.
Blast Radius
ecosystem impact- 1 pypi packages depend on pypdf (1 direct, 0 indirect)
Ecosystem-wide dependent count for version 6.12.1.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Memory exhaustion while parsing crafted PDFs in pypdf versions prior to 6.21.3 allows an attacker to drive a consuming p
Denial of service in pypdf before 6.21.3: retrieving the page count (for example via len(reader.pages) or get_num_pages(
Memory exhaustion in the pypdf PDF library before 6.21.3 allows a small, deliberately malformed PDF dictionary to blow u
pypdf before 6.21.3 can be driven into excessive CPU consumption when an application retrieves page labels from a specia
Cloning or duplicating a crafted cyclic DictionaryObject with pypdf before 6.21.4 can hang the calling process in an inf
Parsing a crafted PDF with pypdf before 6.21.4 can drive disproportionate memory consumption when the library enumerates
Denial of service in pypdf prior to 6.21.4 lets remote attackers hang a PDF-processing thread by supplying an incomplete
Infinite loop denial of service in pypdf prior to 6.16.0 allows any attacker who can supply a crafted PDF to a pypdf-bas
Infinite loop denial-of-service in pypdf prior to 6.13.1 allows an attacker to hang any process that merges a crafted PD
pypdf is a pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files. Rat
pypdf is a pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files. Rat
pypdf is an open source, pure-python PDF library. Rated medium severity (CVSS 5.5), this vulnerability is no authenticat
EUVD-2026-32912
GHSA-wjqc-6w8f-h24c
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB