Skip to main content

pypdf CVE-2026-82398

| EUVDEUVD-2026-68894 MEDIUM
Inefficient Algorithmic Complexity (CWE-407)
2026-08-31 GitHub_M GHSA-fc8x-2rww-xw9m
6.9
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit crafted PDF to any pypdf-backed input
  2. Delivery
    read_until_whitespace called on malicious stream
  3. Exploit
    O(N²) byte-copy loop saturates CPU
  4. Execution
    Worker process stalls for seconds to minutes
  5. Impact
    Service 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 read_until_whitespace on a crafted stream. No authentication, privileged configuration, or non-default settings are required; the CVSS 4.0 metrics PR:N/UI:N/AC:L/AT:N confirm zero-barrier network exploitation. Exploitation impact scales directly with the length of the non-whitespace run and the number of concurrent malicious requests relative to available worker processes. The only structural limit is that the attacker must be able to deliver a PDF file to a service running a vulnerable pypdf version; systems that never process external PDF input or that restrict file uploads to trusted authenticated users face significantly reduced exposure.

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 read_until_whitespace, the quadratic loop consumes all available CPU on the worker for an extended period. Repeating submissions of such files exhausts the worker pool and denies service to legitimate users without requiring any authentication or account.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

pypdf < 6.15.0

Affected Packages

pypi pypdf fix: 6.15.0

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

Vendor (GitHub_M) PRIMARY 6.9 MEDIUM
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
vuln.today AI 7.5 HIGH

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.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE 5.3 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Red Hat 5.3 MEDIUM

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Aug 31, 2026 - 23:02 EUVD

DescriptionCVE.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

EPSS Score
0.3%
Top 78% exploitable
Prevalence
Medium
popular Python PDF library, not universally deployed across all environments
Threat Intel
1
1 sources
Data Quality
8 sources
Confidence: High
EUVD 🇯🇵JVN NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

More in Pypdf

View all
CVE-2026-119209 HIGH POC
7.1 Oct 29

Memory exhaustion while parsing crafted PDFs in pypdf versions prior to 6.21.3 allows an attacker to drive a consuming p

CVE-2026-119208 HIGH POC
7.1 Oct 29

Denial of service in pypdf before 6.21.3: retrieving the page count (for example via len(reader.pages) or get_num_pages(

CVE-2026-119207 HIGH POC
7.1 Oct 29

Memory exhaustion in the pypdf PDF library before 6.21.3 allows a small, deliberately malformed PDF dictionary to blow u

CVE-2026-119206 HIGH POC
7.1 Oct 29

pypdf before 6.21.3 can be driven into excessive CPU consumption when an application retrieves page labels from a specia

CVE-2026-119205 HIGH POC
7.1 Oct 29

Cloning or duplicating a crafted cyclic DictionaryObject with pypdf before 6.21.4 can hang the calling process in an inf

CVE-2026-119204 HIGH POC
7.1 Oct 29

Parsing a crafted PDF with pypdf before 6.21.4 can drive disproportionate memory consumption when the library enumerates

CVE-2026-119203 HIGH POC
7.1 Oct 29

Denial of service in pypdf prior to 6.21.4 lets remote attackers hang a PDF-processing thread by supplying an incomplete

CVE-2026-84309 MEDIUM POC
6.9 Sep 01

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

CVE-2026-54651 MEDIUM POC
6.9 Jun 22

Infinite loop denial-of-service in pypdf prior to 6.13.1 allows an attacker to hang any process that merges a crafted PD

CVE-2023-36810 MEDIUM POC
6.5 Jun 30

pypdf is a pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files. Rat

CVE-2023-36807 MEDIUM POC
6.5 Jun 30

pypdf is a pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files. Rat

CVE-2023-36464 MEDIUM POC
5.5 Jun 27

pypdf is an open source, pure-python PDF library. Rated medium severity (CVSS 5.5), this vulnerability is no authenticat

Vendor StatusVendor

SUSE

Severity: Moderate

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy