CVE-2026-84310 Overview
CVE-2026-84310 is a resource exhaustion vulnerability in pypdf, a pure-Python PDF library. Versions prior to 6.16.1 fail to enforce global entry-count and nesting-depth limits when traversing document outlines. An attacker can craft a malicious PDF containing outlines with large numbers of entries or deeply nested reused paths. Processing such a file via the _get_outline function in pypdf/_doc_common.py causes prolonged runtimes and excessive memory consumption. The issue is tracked under CWE-405: Asymmetric Resource Consumption and is fixed in pypdf 6.16.1.
Critical Impact
A crafted PDF can exhaust CPU and memory in any application that invokes pypdf outline retrieval, causing local denial of service.
Affected Products
- pypdf versions prior to 6.16.1
- Python applications embedding pypdf for PDF parsing or outline extraction
- Automated document processing pipelines relying on pypdf
Discovery Timeline
- 2026-09-01 - CVE-2026-84310 published to NVD
- 2026-09-01 - Last updated in NVD database
Technical Details for CVE-2026-84310
Vulnerability Analysis
The flaw resides in the outline traversal logic of pypdf. When _get_outline walks the outline tree of a PDF, it follows references to child outline items recursively. The pre-patch implementation did not track a global entry count or a maximum nesting depth. A PDF authored with cyclic or reused indirect object references can therefore force the traversal to revisit paths repeatedly, expanding into an effectively unbounded traversal graph.
The resulting behavior is algorithmic complexity abuse. CPU time and heap allocations grow well beyond the on-disk size of the input file, producing a denial-of-service condition against the host process.
Root Cause
The root cause is missing traversal bounds in pypdf/_doc_common.py. Outline retrieval used only local recursion guards rather than global counters. Malformed or maliciously nested outline dictionaries were not detected before they consumed process resources.
Attack Vector
Exploitation requires an application or user to open a crafted PDF with a vulnerable pypdf version and invoke outline extraction. The attack vector is local and requires user interaction, so remote exploitation depends on upstream workflows that ingest untrusted PDFs.
# Patch excerpt from pypdf/_utils.py introducing traversal accounting
# Source: https://github.com/py-pdf/pypdf/commit/d91ab705fd81ed1a9cec175c6958600dea1a4942
@dataclass
class _TraversalState:
"""Sometimes we need mutable objects which just count something."""
entry_count: int = 0
has_logged: bool = False
The patch introduces a _TraversalState dataclass that pypdf now threads through outline and XForm traversal. It provides a shared entry_count counter that enforces a global cap and a has_logged flag to avoid repeated log spam once the limit is reached. See the GitHub Pull Request #3966 and GitHub Security Advisory GHSA-23w6-3w8w-8484 for the full change set.
Detection Methods for CVE-2026-84310
Indicators of Compromise
- Python processes running pypdf that show sustained high CPU usage while parsing a single PDF file
- Rapid resident memory growth in worker processes tied to PDF outline extraction
- Application timeouts, OOM kills, or worker restarts correlated with PDF ingestion jobs
- Log entries from pypdf indicating outline traversal warnings once patched builds are deployed
Detection Strategies
- Inventory Python environments and CI pipelines to enumerate installed pypdf versions using pip show pypdf or SBOM tooling
- Add software composition analysis rules that flag pypdf < 6.16.1 in build artifacts and container images
- Instrument PDF-processing services with per-request CPU and memory quotas so anomalous jobs are surfaced
Monitoring Recommendations
- Alert when pypdf worker processes exceed a defined runtime threshold on a single document
- Track resident set size for document parsing services and alert on sudden growth patterns
- Correlate PDF ingestion source, file hash, and processing duration to identify recurring malicious inputs
How to Mitigate CVE-2026-84310
Immediate Actions Required
- Upgrade pypdf to version 6.16.1 or later across all applications, containers, and virtual environments
- Rebuild and redeploy container images and serverless functions that bundle pypdf as a dependency
- Enforce process-level CPU time and memory limits for any service that parses untrusted PDFs
Patch Information
The fix ships in GitHub Release v6.16.1 and was introduced by commit d91ab705. The change limits iterations for outline retrieval and XForm text extraction via a shared _TraversalState counter.
Workarounds
- Avoid calling outline extraction APIs on untrusted PDF documents until upgrading
- Run PDF processing in sandboxed workers with strict ulimit or cgroup CPU and memory constraints
- Reject PDFs whose file size or structural metrics exceed expected thresholds before invoking pypdf
# Upgrade pypdf to the patched release
pip install --upgrade 'pypdf>=6.16.1'
# Verify 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.

