Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted PDF to any pypdf-backed input
-
Deliveryread_until_whitespace called on malicious stream
-
ExploitO(N²) byte-copy loop saturates CPU
-
ExecutionWorker process stalls for seconds to minutes
-
ImpactService availability denied
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V2 - Validation and Business Logic Algorithmic complexity limits
|
| Exploitation Conditions | The target application must invoke pypdf to parse attacker-controlled PDF content - specifically any code path reaching |
| Impact | The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N) confirms network-accessible, unauthenticated exploitation with no special attack preconditions, accurately reflecting that any service exposing pypdf-based PDF parsing to user-supplied files is reachable without friction. The provided VA:L rating likely understates real-world impact: a 1 MB non-whitespace stream triggers roughly half a trillion byte-copy operations, which in practice will stall a CPython worker process for many seconds to minutes depending on hardware - a realistic and repeatable denial of service. EPSS data was not provided in the input, so exploitation probability cannot be quantified; the vulnerability is not listed in the CISA KEV, indicating no confirmed active exploitation. No public exploit code was identified, though the mechanism is trivially reproducible from the published description and PR diff alone. Despite the moderate base score of 6.9, the combination of zero authentication requirements, no user interaction, and a deterministic scalable DoS mechanism elevates practical risk for any service processing untrusted PDFs at volume - the VA:L rating in the provided vector should be re-evaluated against observed hang durations under realistic load. |
| Exploit ScenarioDerived | An attacker submits a specially crafted PDF - via a file upload endpoint, email attachment processor, or document conversion service - in which a stream object contains millions of consecutive non-whitespace bytes. When pypdf processes the file and invokes |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 31, 2026
Quadratic time complexity in pypdf's read_until_whitespace function allows remote unauthenticated attackers to cause denial of service by supplying a crafted PDF containing a long non-whitespace byte stream. All versions prior to 6.15.0 accumulate bytes via immutable concatenation in a single-byte loop, producing O(N²) processing cost that stalls Python worker processes and degrades availability of any PDF-parsing pipeline exposed to untrusted input. A confirmed patch is available as version 6.15.0; no active exploitation has been identified at the time of analysis.
RemediationAI
Upgrade pypdf to version 6.15.0 or later, available via PyPI (pip install 'pypdf>=6.15.0') and confirmed at https://github.com/py-pdf/pypdf/releases/tag/6.15.0. For environments where immediate upgrade is not feasible, enforce a maximum PDF file size limit at the ingestion layer before invoking pypdf - this bounds the maximum non-whitespace run an attacker can supply and caps worst-case processing time, though it does not eliminate the underlying quadratic behavior. A second compensating control is to wrap PDF parsing in a subprocess or thread with an explicit timeout and terminate any parse exceeding a threshold; this prevents a single malicious file from blocking the main process indefinitely but introduces latency overhead and may affect legitimate large PDFs. Neither workaround removes the root cause; upgrading to 6.15.0 is the only complete fix.
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 pure-Python PDF parsing library (CPE: cpe:2.3:a:py-pdf:pypdf:*:*:*:*:*:*:*:*). The vulnerable function read_until_whitespace in pypdf/_utils.py initialized its accumulator as an immutable bytes object (txt = b"") and extended it one byte at a time inside a loop. In CPython, bytes are immutable, so each concatenation allocates a new object of growing size and copies all previously accumulated data - the classic O(N²) string-building antipattern identified by CWE-407 (Inefficient Algorithmic Complexity). For a 1 MB non-whitespace run the loop executes approximately 5×10¹¹ byte-copy operations. The fix, merged in PR #3947 (commit 4959848), replaces the accumulator with a mutable bytearray - which supports O(1) amortized appends - and calls bytes() once at the end, reducing overall complexity to O(N). A performance regression test (test_read_until_whitespace__performance) enforcing a 5-second timeout on a 1 MB input was added to prevent regressions.
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:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
Network-accessible with no authentication or interaction required; quadratic complexity on large non-whitespace input causes near-total worker process unavailability, warranting A:H over A:L.
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
pypdf is a free and open-source pure-python PDF library. Prior to 6.15.0, an attacker can craft a PDF that causes long runtimes when the pypdf/_utils.py function read_until_whitespace reads a stream containing a long run of bytes without whitespace. The function repeatedly performs immutable bytes concatenation in a one-byte loop, causing quadratic processing cost for the long non-whitespace input. This issue is fixed in version 6.15.0.
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
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-68894
GHSA-fc8x-2rww-xw9m
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB