Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessDeliver crafted PDF to pypdf-based service
-
DeliveryVictim opens/parses file with pypdf
-
ExploitXref stream declares huge/negative entry counts
-
ExecutionParser allocates excessive memory
-
ImpactMemory exhaustion denial of service
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption 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 | Triggering requires the application to open and parse an attacker-supplied PDF with pypdf prior to 6.21.3, and the malicious document must use PDF 1.5+ cross-reference streams (the vulnerable code path _read_pdf15_xref_stream); plain classic xref-table PDFs are not affected. The crafted file abuses very large declared entry counts, highly compressible FlateDecode streams, /Prev chains that multiply entries across the document, and negative /Index counts that bypassed the former per-stream clamp. Limiting factors: exploitation needs passive user interaction (a file must be opened/processed, UI:P), affects only availability (memory/DoS) with no data confidentiality or integrity impact, and the fixed release adds a configurable xref_stream_maximum_entries cap (default 2,000,000) plus rejection of negative counts, so patched or limit-configured deployments are protected. |
| Impact | This is a memory-exhaustion denial-of-service issue (CWE-400/CWE-770) in the pypdf library, not a code-execution flaw. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H) is internally consistent with the description: the attack is network-deliverable and low-complexity, requires no privileges, but does require passive user interaction (UI:P) - an application or user must actually open the crafted PDF - and the only impact is availability (VA:H), with no confidentiality or integrity effect. No EPSS score, CISA KEV listing, or SSVC automatable/technical-impact fields were supplied, so exploitation-probability signals are absent rather than low; this cannot be treated as evidence of either high or low real-world exploitation. The vuln.today priority is 'this_week' and a vendor patch exists. Net assessment: a genuine but bounded availability risk - real priority for services that parse untrusted PDFs with pypdf, but it does not threaten data or system integrity and depends on the affected code path (cross-reference streams) being reached. Confirmed by the GHSA advisory and merged fix; exploitation telemetry (EPSS/KEV) is simply not present in the input, which should be stated rather than inferred. |
| Exploit ScenarioDerived | An attacker submits a specially crafted PDF to a service or user that parses it with a vulnerable pypdf version - for example an upload-processing backend, mail/attachment pipeline, or document viewer. The PDF uses cross-reference streams with inflated entry counts, highly compressible stream data, /Prev chains, and negative /Index counts to multiply parsed entries far beyond the file's size, driving pypdf to allocate excessive memory and exhausting the host, degrading or crashing the service. The merged pull request #4269 includes test code that constructs such triggering PDFs, so the crafting technique is publicly documented. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 29, 2026
Memory exhaustion while parsing crafted PDFs in pypdf versions prior to 6.21.3 allows an attacker to drive a consuming process toward out-of-memory and crash it, giving a denial of service (availability-only impact, rated 7.1 under CVSS 4.0). Only applications that open untrusted PDFs through pypdf are exposed, and the malicious document must use PDF 1.5+ cross-reference streams rather than classic xref tables; a user or service must actually open/process the file, which is why the vector carries a user-interaction requirement. No confirmed active exploitation (no CISA KEV listing) and no public exploit identified at time of analysis; the vendor-released fix is version 6.21.3, which adds a configurable entry cap and rejects negative /Index counts.
RemediationAI
Upgrade to pypdf 6.21.3, the vendor-released patch version, available from https://github.com/py-pdf/pypdf/releases/tag/6.21.3 and pinned in requirements as pypdf>=6.21.3; the advisory at https://github.com/py-pdf/pypdf/security/advisories/GHSA-x3rh-gjgm-fmqc records the fix. If upgrading immediately is not possible, the vendor states you can apply the changes from PR https://github.com/py-pdf/pypdf/pull/4269 (commit a93fe3a901fd00af38f0a105c3ba7175fa72dcb4), which adds the xref_stream_maximum_entries reader parameter (default 2,000,000), enforces a document-wide xref-stream entry cap across /Prev chains, and neutralizes negative /Index counts; the trade-off is that the cap must be set high enough for legitimate large documents, otherwise valid PDFs will raise LimitReachedError. On patched code the cap remains tunable per deployment for resource-constrained environments.
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
The flaw lives in pypdf's PDF 1.5 cross-reference stream parser (_read_pdf15_xref_stream) and is a resource-consumption class issue (CWE-400 uncontrolled resource consumption, tracked upstream as CWE-770). Cross-reference streams describe objects with /W-width encoded fields and an /Index array of (start, count) pairs; the library trusts the declared counts and allocates/parses entries accordingly. Three factors compound: the streams are FlateDecode-compressed and highly compressible, so a small file expands into a very large entry set; /Prev chains let a document link multiple xref streams so entry counts accumulate across the whole file rather than per stream; and negative /Index counts previously bypassed the existing per-stream clamp, allowing arbitrarily large declared counts. The current per-stream clamp was therefore ineffective against multi-stream accumulation. The fix (merged via PR #4269) introduces a reader option xref_stream_maximum_entries with a default of 2,000,000, accumulates a document-wide entry counter across trailers, raises LimitReachedError when the cap is exceeded, and normalizes negative /Index counts to zero (raising PdfStreamError in strict mode, warning otherwise). Classic xref-table PDFs do not traverse this code path and are unaffected. The assessed CVSS vector is AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H: remote-reachable but requiring the victim to open a crafted file, with no confidentiality or integrity impact.
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:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Crafted PDF is remotely deliverable (AV:N, AC:L, PR:N) but must be opened (UI:R); impact is memory exhaustion only, so A:H with C:N/I:N and unchanged scope.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
pypdf is a free and open-source pure-python PDF library. Prior to 6.21.3, pypdf can consume excessive memory while opening a crafted PDF containing cross-reference streams that declare very large entry counts. Highly compressible streams and /Prev chains can multiply the number of parsed entries across a document, while negative /Index counts can bypass the existing per-stream clamp. This issue is fixed in version 6.21.3.
Blast Radius
ecosystem impact- 1 pypi packages depend on pypdf (1 direct, 0 indirect)
Ecosystem-wide dependent count for version 6.21.3.
Technical POC Analysis
CWE-400 (Uncontrolled Resource Consumption), with the advisory also tagging CWE-770 (Allocation of Resources Without Limits or Throttling).
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Latest POC
1 PoC candidate from github (unverified)
Sign in to open the public PoC links collected for this CVE.
Executive ViewAI
A high-severity vulnerability in the pypdf library (versions before 6.21.3) can cause memory exhaustion and crash any application that processes untrusted PDFs, directly threatening service availability. The impact is operational-disruption to document-handling workflows-and affects only systems that use pypdf to open PDFs from untrusted sources.
Apply vendor patch.
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.
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
Resource exhaustion in pypdf prior to 6.16.1 allows an attacker who can supply a crafted PDF to cause denial of service
EUVD-2026-113381
GHSA-x3rh-gjgm-fmqc
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB