Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-113789 Overview
CVE-2026-113789 is a resource exhaustion vulnerability [CWE-400] in pypdf, a pure-Python PDF library widely used across data processing, document automation, and web application pipelines. Versions prior to 6.21.0 allow an attacker to craft a PDF that triggers excessive memory consumption or extended runtimes when an application retrieves the document's form fields. The maintainers addressed the issue in release 6.21.0 by introducing configurable bounds on form field count and depth.
Critical Impact
An attacker can submit a malicious PDF to any service that enumerates form fields using pypdf, causing denial of service through CPU and memory exhaustion.
Affected Products
- pypdf versions prior to 6.21.0
- Applications and services that call form field retrieval APIs on untrusted PDF input
- Document processing pipelines embedding pypdf as a dependency
Discovery Timeline
- 2026-10-21 - CVE-2026-113789 published to the National Vulnerability Database (NVD)
- 2026-10-22 - Last updated in NVD database
Technical Details for CVE-2026-113789
Vulnerability Analysis
The vulnerability is an uncontrolled resource consumption flaw [CWE-400] in pypdf's form field handling. When an application retrieves form fields from a PDF, pypdf traverses the AcroForm field hierarchy embedded in the document. Prior to version 6.21.0, the traversal did not enforce limits on the number of fields or the depth of the field tree. A crafted PDF can declare a very large number of form fields or a deeply nested field structure, forcing pypdf into prolonged processing and large memory allocations.
The impact is denial of service against the host application. Backend services that automatically parse user-uploaded PDFs are the most exposed, since a single malicious upload can block worker threads or exhaust process memory.
Root Cause
The root cause is missing input bounds on the AcroForm field tree traversal. pypdf recursively walked referenced field objects without capping entry count or recursion depth, allowing attacker-controlled structural complexity to translate directly into unbounded work. The fix in pull request #4219 introduces two configurable limits, form_fields_maximum_entries and form_fields_maximum_depth, enforced during field retrieval.
Attack Vector
Exploitation requires an attacker to deliver a crafted PDF to a target that calls pypdf form field APIs. The attack is network-reachable in any workflow accepting PDF uploads, email attachments, or links to remote documents. No authentication is required when the target endpoint accepts anonymous uploads. User interaction is limited to opening or submitting the document to the processing pipeline.
# Patch excerpt from pypdf/_configuration.py introducing bounded limits
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
"""The maximum allowed number of ``/XObject`` forms per page during text extraction."""
Source: GitHub commit 5ef728f
Detection Methods for CVE-2026-113789
Indicators of Compromise
- Sustained high CPU or memory usage from Python worker processes immediately after a PDF upload.
- Request timeouts, worker restarts, or out-of-memory kills in services that invoke pypdf form field retrieval.
- PDF uploads containing abnormally large AcroForm structures or deeply nested field dictionaries.
Detection Strategies
- Inspect dependency manifests (requirements.txt, pyproject.toml, Pipfile.lock) for pypdf versions below 6.21.0.
- Instrument the PDF parsing code path with runtime metrics for processing time and peak memory per document.
- Add pre-parse checks that reject PDFs whose raw size or AcroForm entry count exceeds a safe threshold.
Monitoring Recommendations
- Alert on anomalous spikes in parser latency, memory footprint, or worker termination rates on PDF ingestion services.
- Correlate upload source IPs with repeated resource-exhaustion events to identify abusive clients.
- Log the version of pypdf loaded at service startup to confirm patched builds are deployed in production.
How to Mitigate CVE-2026-113789
Immediate Actions Required
- Upgrade pypdf to version 6.21.0 or later across all services, build artifacts, and container images.
- Audit internal and third-party packages for transitive dependencies on vulnerable pypdf versions.
- Enforce request-level timeouts and per-worker memory limits on any process that parses untrusted PDFs.
Patch Information
The fix is included in pypdf release 6.21.0 and tracked in GHSA-6vvc-x485-93v7. The patch adds the form_fields_maximum_entries and form_fields_maximum_depth configuration options, which bound the work performed during form field retrieval.
Workarounds
- Restrict PDF upload size and reject documents exceeding a reasonable byte threshold before parsing.
- Execute pypdf operations in isolated worker processes with hard CPU and memory ceilings using cgroups, container limits, or resource.setrlimit.
- Place PDF processing behind a queue with concurrency caps to prevent a single malicious document from starving the service.
# Upgrade pypdf to the patched release
pip install --upgrade "pypdf>=6.21.0"
# Verify the installed version
python -c "import pypdf; print(pypdf.__version__)"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

