Skip to main content
Vulnerability Database/CVE-2026-113792

CVE-2026-113792: pypdf Library DOS Vulnerability

CVE-2026-113792 is a denial of service vulnerability in pypdf library that causes infinite loops when processing malicious PDFs with cyclic outline hierarchies. This post explains its impact, affected versions, and mitigation steps.

Published:

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-113792 Overview

CVE-2026-113792 is a denial-of-service vulnerability in pypdf, a widely used pure-Python PDF library. Versions prior to 6.20.1 fail to detect cyclic references in a PDF document's outline hierarchy. When an application calls PdfWriter.find_outline_item on a crafted PDF, the function enters an infinite loop and blocks the current process. The weakness is tracked as CWE-835: Loop with Unreachable Exit Condition. The maintainers released a fix in version 6.20.1.

Critical Impact

Processing a malicious PDF through find_outline_item causes an infinite loop that stalls the host process, enabling denial of service against automated PDF workflows.

Affected Products

  • pypdf versions prior to 6.20.1
  • Python applications and services that invoke PdfWriter.find_outline_item on untrusted PDF input
  • Downstream libraries and automation pipelines bundling vulnerable pypdf releases

Discovery Timeline

  • 2026-10-21 - CVE-2026-113792 published to NVD
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2026-113792

Vulnerability Analysis

The flaw resides in the find_outline_item method of PdfWriter within pypdf/_writer.py. The method walks the outline tree by following /First and /Next entries to locate a matching outline item. The original implementation did not track previously visited nodes. A PDF author can construct an outline hierarchy where a node references an ancestor, creating a cycle. Traversal of that cycle never terminates, consuming CPU and blocking the thread that invoked the call.

The practical impact depends on how the host application exposes PDF processing. Server-side converters, document ingestion pipelines, and SaaS endpoints that accept user-supplied PDFs are the most exposed. A single crafted document can occupy a worker indefinitely, degrading throughput or triggering timeouts across the pool.

Root Cause

The root cause is missing cycle detection during tree traversal. The while outline is not None loop advances through outline nodes without recording which indirect references it has already seen, so a self-referential or cyclic outline keeps the condition true forever.

Attack Vector

Exploitation requires network delivery of a crafted PDF and user or application interaction to invoke the vulnerable method. The attacker does not need authentication. The result is availability loss limited to the processing component; confidentiality and integrity are not affected.

python
    def find_outline_item(
        self,
-        outline_item: dict[str, Any],
+        outline_item: Union[IndirectObject, str],
        root: Optional[OutlineType] = None,
+        *,
+        visited: Optional[set[int]] = None,
    ) -> Optional[list[int]]:
        if root is None:
-            o = self.get_outline_root()
+            outline = self.get_outline_root()
        else:
-            o = cast("TreeObject", root)
+            outline = cast("TreeObject", root)
+        if visited is None:
+            visited = set()

-        i = 0
-        while o is not None:
+        index = 0
+        while outline is not None:
            if (
-                o.indirect_reference == outline_item
-                or o.get("/Title", None) == outline_item
+                outline.indirect_reference == outline_item
+                or outline.get("/Title", None) == outline_item
            ):
-                return [i]
-            if "/First" in o:

Source: GitHub Commit c9c35b4. The patch introduces a visited set to record indirect references already processed, breaking cyclic traversal.

Detection Methods for CVE-2026-113792

Indicators of Compromise

  • Python worker processes stuck at 100% CPU usage while handling a PDF upload, with stack traces pointing to pypdf/_writer.py and find_outline_item.
  • Repeated timeouts or watchdog restarts in PDF processing services after specific documents are submitted.
  • Inbound PDF files containing outline entries whose /First, /Next, or /Parent references form a cycle.

Detection Strategies

  • Inventory Python environments and container images for pypdf releases earlier than 6.20.1 using software composition analysis.
  • Instrument the PDF processing pipeline with per-call timeouts around find_outline_item and log any invocations that exceed a baseline threshold.
  • Perform static analysis of incoming PDFs to flag outline hierarchies that reference prior nodes, using a parser that enforces visited-node tracking.

Monitoring Recommendations

  • Alert on sustained CPU saturation in document-processing workers combined with elevated request latency.
  • Capture process stack samples when workers are terminated for timeout, and ingest them into the Singularity Data Lake for correlation with upload metadata.
  • Track outbound 5xx responses and queue backlogs tied to the PDF endpoint to identify sustained exploitation attempts.

How to Mitigate CVE-2026-113792

Immediate Actions Required

  • Upgrade pypdf to version 6.20.1 or later across all applications, container images, and build pipelines.
  • Rebuild and redeploy services that statically bundle pypdf, including serverless functions and Lambda layers.
  • Enforce size and processing timeouts on any endpoint that accepts user-supplied PDFs until patched versions are confirmed in production.

Patch Information

The fix is published in the pypdf 6.20.1 release and tracked in GHSA-qfv9-64jg-mh7p. The code change is implemented in Pull Request #4188, which adds cycle detection via a visited set. Install the fixed release with pip install --upgrade pypdf.

Workarounds

  • Avoid calling PdfWriter.find_outline_item on untrusted PDF documents until the upgrade is complete.
  • Isolate PDF processing in short-lived worker processes with hard wall-clock limits so an infinite loop terminates the worker rather than the service.
  • Pre-validate incoming PDFs with a parser that rejects outline trees containing duplicate indirect references.
bash
# Upgrade pypdf to the patched release
pip install --upgrade 'pypdf>=6.20.1'

# Verify the installed version
python -c "import pypdf; print(pypdf.__version__)"

# Pin the fixed version in requirements.txt
echo 'pypdf>=6.20.1' >> requirements.txt

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.