CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-113789

CVE-2026-113789: Algorithmic Complexity and Resource Exhaustion in pypdf Interactive Form Parsing

Alon Barad
Alon Barad
Software Engineer

Oct 23, 2026·5 min read·10 visits

Executive Summary (TL;DR)

pypdf prior to version 6.21.0 suffers from quadratic O(N^2) complexity in form field cycle detection and lacks traversal depth limits, enabling denial-of-service via malformed PDFs.

An uncontrolled resource consumption and inefficient algorithmic complexity vulnerability in pypdf prior to version 6.21.0 allows remote attackers to trigger application-level denial-of-service (DoS) via crafted PDF form field hierarchies.

Vulnerability Overview

The Python library pypdf (formerly PyPDF2) is an open-source tool widely utilized for extracting text, merging pages, and parsing document structures from PDF files. Within its interactive form field processing module, pypdf provides methods such as get_fields(), _build_field(), and _check_kids() to traverse hierarchical field structures and extract form field metadata.

When processing untrusted PDF documents containing complex or synthetic interactive form fields (/AcroForm and /Fields trees), versions of pypdf prior to 6.21.0 exhibit critical efficiency bottlenecks. Specifically, cycle detection during recursive tree traversal was implemented using sequential array lookups over a growing list of traversed nodes, leading to quadratic time complexity ($O(N^2)$).

In addition to the time complexity flaw, the parser lacked upper boundaries for recursion depth and total processed form field entries. Consequently, an unauthenticated attacker capable of submitting a tailored PDF file to a service using pypdf can cause severe CPU starvation and memory exhaustion, resulting in thread blockages or process failure.

Root Cause Analysis

The root cause of CVE-2026-113789 consists of two interrelated defects located in pypdf/_doc_common.py: linear cycle detection lookup (CWE-407) and missing input structural boundaries (CWE-400).

During recursive traversal of field hierarchies, child objects referenced in /Kids arrays are checked for cyclical references to prevent infinite recursive loops. In affected versions, this check relied on a Python list passed via the stack parameter:

if tree in stack:
    return
stack.append(tree)

In Python, evaluating tree in stack on a list object forces a linear scan ($O(N)$) through every previously visited node. As the total number of field nodes $N$ increases (for instance, in PDFs containing 20,000 or more widget annotations), each node lookup takes time proportional to $N$. The cumulative complexity of traversing the tree scales quadratically ($O(N^2)$), consuming CPU time exponentially relative to element count.

Furthermore, the parser contained no guardrails regarding maximum traversal depth or total total node counts. Because PDF object dictionaries can contain deeply nested child references, an attacker can construct a tree structure that consumes hundreds of megabytes of memory and holds CPU execution in tight loop iterations for tens of seconds per document.

Code Analysis & Patch Inspection

The vulnerability was remediated in commit 5ef728f0e16d225c853e89f861ba0a67402fe3f2 (PR #4219) and released in pypdf version 6.21.0.

The fix introduces two major modifications: converting the identity tracking structure to an $O(1)$ hash set and establishing runtime execution limits in Configuration (pypdf/_configuration.py).

# File: pypdf/_configuration.py
@@ -106,6 +106,11 @@ class Configuration:
     page_tree_maximum_depth: int = 100
     """The maximum allowed depth of the page tree."""
 
+    form_fields_maximum_entries: int = 100_000
+    """The maximum allowed number of form fields."""
+    form_fields_maximum_depth: int = 100
+    """The maximum allowed depth for form fields."""
+
     xform_maximum_invocations_per_extraction: int = 5_000

In pypdf/_doc_common.py, the cycle detection algorithm was rewritten to use Python object memory identifiers (id(tree)) stored within a hash set visited: set[int]:

# File: pypdf/_doc_common.py
@@ -789,17 +828,26 @@ def _check_kids(
         visited: set[int],
         depth: int,
         traversal_state: _TraversalState,
     ) -> None:
-        if tree in stack:
+        tree_id = id(tree)
+        if tree_id in visited:
             logger_warning(
                 "%(field_name)s already parsed",
                 source=__name__,
                 field_name=self._get_qualified_field_name(parent=tree),
             )
             return
-        stack.append(tree)
+        visited.add(tree_id)

By replacing tree in stack (list membership, $O(N)$) with tree_id in visited (set hash lookup, $O(1)$), average iteration complexity drops from $O(N^2)$ to linear $O(N)$. Furthermore, traversal functions now evaluate _depth and _traversal_state.entry_count against configurable limits, throwing LimitReachedError when boundaries are breached.

Exploitation Mechanics

Exploitation of CVE-2026-113789 relies on delivery of a specially crafted PDF document to any application endpoint that automatically calls reader.get_fields() or writer.get_fields() on uploaded or ingested files.

The attack vector requires no authentication or user privilege on the target platform. The payload structure consists of a standard PDF document header containing a valid interactive form dictionary (/AcroForm) with an extensive /Fields array or deeply chained child dictionaries (/Kids).

When get_fields() processes a synthetic PDF file containing 30,000 dummy form fields, an unpatched system spends seconds in loop operations performing identity comparisons. Multiple concurrent uploads of such files will rapidly deplete worker process pools in web applications (such as Gunicorn or Uvicorn workers), causing full HTTP service unresponsiveness.

Impact Assessment & Security Risk

The primary impact of CVE-2026-113789 is high availability impairment (Denial of Service). The vulnerability has no impact on system confidentiality or data integrity.

According to CVSS v4.0 metrics, the issue receives a base score of 6.0 (CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N). The requirement metric AT:P reflects the necessity of triggering form field extraction methods specifically within downstream application logic.

Systems most exposed to this vulnerability include centralized document processing platforms, automated invoice parser services, cloud storage indexing agents, and compliance screening gateways that automatically analyze incoming PDF uploads. Because processing occurs synchronously on service worker threads, triggering the bug can easily result in complete service outage across multi-tenant environments.

Remediation & Mitigation Guidance

To fully remediate CVE-2026-113789, organizations must update pypdf to version 6.21.0 or later.

pip install --upgrade "pypdf>=6.21.0"

In environments handling high-risk untrusted documents where immediate package upgrades are delayed, applications can enforce strict runtime limits using the newly exposed apply_configuration context manager:

from pypdf import PdfReader, apply_configuration
from pypdf.errors import LimitReachedError
 
reader = PdfReader("untrusted_input.pdf")
 
try:
    with apply_configuration(form_fields_maximum_entries=5000, form_fields_maximum_depth=20):
        fields = reader.get_fields()
except LimitReachedError as err:
    # Gracefully reject malicious or over-complex PDF files
    logger.warning(f"Rejected complex PDF form structure: {err}")

Additionally, applications parsing user-provided PDF files should wrap PDF extraction tasks in isolated worker subprocesses with strict timeout mechanisms and memory ceilings using system-level tools (e.g., cgroups or systemd resource limits).

Official Patches

pypdf (GitHub)Pull Request #4219: Fix performance and recursion boundaries in form field parsing
pypdf (GitHub Release)Release tag for pypdf version 6.21.0

Technical Appendix

CVSS Score
6.0/ 10
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
EPSS Probability
0.32%
Top 77% most exploited

Affected Systems

pypdf prior to 6.21.0Python applications calling get_fields() on untrusted PDF filesAutomated PDF document processing pipelines
AttributeDetail
CWE IDCWE-400 / CWE-407
Attack VectorNetwork (Unauthenticated PDF Submission)
CVSS v4.0 Score6.0 (Medium)
EPSS Score0.00317 (23.44th percentile)
ImpactDenial of Service (CPU & Memory Exhaustion)
Exploit StatusNo public weaponized exploit detected
CISA KEV StatusNot listed
CWE-400
Uncontrolled Resource Consumption

Vulnerability Timeline

Fix commit merged in py-pdf/pypdf repository via PR #4219
2026-10-16
GitHub Advisory GHSA-6vvc-x485-93v7 published and CVE-2026-113789 assigned
2026-10-21
pypdf version 6.21.0 published on PyPI containing security patch
2026-10-21

References & Sources

  • [1]GitHub Security Advisory GHSA-6vvc-x485-93v7
  • [2]Fix Commit 5ef728f0e16d225c853e89f861ba0a67402fe3f2
  • [3]NVD Vulnerability Details CVE-2026-113789
Related Vulnerabilities
CVE-2023-36464

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•26 minutes ago•CVE-2026-126300
5.3

CVE-2026-126300: Algorithmic Complexity Denial of Service in NLTK TreebankWordTokenizer.span_tokenize

CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.

Amit Schendel
Amit Schendel
1 views•10 min read
•about 1 hour ago•GHSA-GPWC-27CW-RH9R
5.3

CVE-2026-126301: Quadratic CPU Exhaustion in NLTK LegalitySyllableTokenizer

The Natural Language Toolkit (NLTK) versions 3.6 through 3.10.3 contain an algorithmic complexity vulnerability in the LegalitySyllableTokenizer.tokenize method. When processing tokens composed of continuous runs of vowels, an unguarded string reversal and set membership lookup loop executes in quadratic time relative to the input token length. Remote attackers capable of submitting arbitrary text to applications utilizing this tokenizer can trigger sustained single-core CPU exhaustion and application-level denial of service.

Amit Schendel
Amit Schendel
3 views•10 min read
•about 2 hours ago•CVE-2026-126304
8.7

CVE-2026-126304: Symlink Path Traversal in NLTK YCOECorpusReader

CVE-2026-126304 is a symlink path traversal vulnerability (CWE-59) in the Natural Language Toolkit (NLTK) versions 3.10.0 prior to 3.10.4. The YCOECorpusReader class constructs internal sub-readers for the 'psd' and 'pos' subdirectories using FileSystemPathPointer.join(), which relies exclusively on lexical string-prefix validation rather than canonical path resolution. An attacker who supplies a crafted YCOE corpus containing symbolic links in place of the 'psd' or 'pos' subdirectories can bypass directory confinement and read arbitrary files from sibling corpora or sensitive directories within the NLTK data sandbox.

Amit Schendel
Amit Schendel
4 views•9 min read
•about 3 hours ago•CVE-2026-128077
6.5

CVE-2026-128077: Authorization Bypass via Request Path Desynchronization in Nuxt and @nuxt/nitro-server

CVE-2026-128077 (GHSA-r99w-jh2x-3mg9) is an authorization bypass and interpretation conflict vulnerability affecting Nuxt and its underlying @nuxt/nitro-server package in versions 4.6.0 through 4.6.3. When an incoming HTTP request path begins with a double forward slash (e.g., //x/admin), the WHATWG URL parser within the Nuxt server-side page renderer interprets the initial segment as a network host/authority and resolves the remaining path (/admin) against the application's page router. Because Nitro server middleware, route-scoped serverHandlers, and Nitro routeRules evaluate the unparsed request path (//x/admin), path-based access controls, redirects, and security header policies configured for /admin fail to match and are bypassed.

Amit Schendel
Amit Schendel
5 views•10 min read
•about 4 hours ago•CVE-2026-128084
4.8

CVE-2026-128084: Integer Truncation and SQL Query Truncation in sqlite3-ruby

Prior to version 2.10.2, the sqlite3-ruby gem explicitly cast 64-bit Ruby string lengths (long) to 32-bit signed integers (int) when invoking the underlying SQLite C API. On 64-bit platforms, providing a string of 4 GiB (2^32 bytes) or larger causes integer truncation, instructing SQLite to process only a prefix of the string. This flaw affects SQL query preparation, bound parameter values, and return values from custom Ruby-defined SQL functions and aggregates, allowing trailing SQL clauses such as WHERE restrictions to be silently dropped under specific conditions.

Alon Barad
Alon Barad
5 views•11 min read
•about 5 hours ago•CVE-2026-128068
5.3

CVE-2026-128068: Regular Expression Denial of Service in rails-html-sanitizer

CVE-2026-128068 (GHSA-cpgf-5mjf-73p7) is a Regular Expression Denial of Service (ReDoS) vulnerability in the rails-html-sanitizer Ruby gem affecting versions 1.0.3 through 1.7.1. The flaw resides in the Rails::HTML::PermitScrubber#scrub_attribute method, which uses the multiline regular expression /^\s*[^#\s].*/m to enforce local-only URI fragment references on SVG elements. On Ruby runtimes prior to version 3.2 (CRuby <= 3.1 and JRuby), evaluating an attribute value composed of repeated newline and whitespace characters without a hash character triggers quadratic backtracking O(n^2). Applications are only vulnerable if their sanitization allowlist is explicitly configured to permit SVG reference elements such as <use> alongside href or xlink:href attributes.

Alon Barad
Alon Barad
6 views•9 min read