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

CVE-2026-113790: pypdf Library DOS Vulnerability

CVE-2026-113790 is a denial of service vulnerability in the pypdf library that allows attackers to consume excessive memory through malicious PDFs. This post covers the technical details, affected versions, and mitigation strategies.

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

CVE-2026-113790 is a resource exhaustion vulnerability in pypdf, a widely used pure-Python PDF library. Versions prior to 6.21.0 allow an attacker to craft a PDF containing arrays or dictionaries with an excessive number of elements. Parsing such a document causes the library to consume large amounts of memory, resulting in a denial of service against the host process. The weakness is classified as [CWE-400: Uncontrolled Resource Consumption]. The issue is fixed in pypdf version 6.21.0.

Critical Impact

Any application that ingests untrusted PDFs through pypdf can be forced into a memory-exhaustion denial of service by a single crafted document.

Affected Products

  • pypdf versions prior to 6.21.0
  • Python applications and services that parse untrusted PDF files via pypdf
  • Downstream libraries and pipelines that embed pypdf for PDF ingestion

Discovery Timeline

  • 2026-10-21 - CVE-2026-113790 published to the National Vulnerability Database (NVD)
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2026-113790

Vulnerability Analysis

The vulnerability resides in the generic object parser in pypdf. When the parser encounters a PDF array ([ ... ]) or dictionary (<< ... >>), it iterates over every element declared in the object and constructs corresponding Python objects. Prior to 6.21.0, no upper bound existed on the number of elements that could be parsed from a single array or dictionary. An attacker can therefore embed a composite object with millions of entries, forcing the parser to allocate memory proportional to the attacker-controlled element count. The result is a denial-of-service condition in which the Python process grows until the operating system kills it or system memory is exhausted.

Root Cause

The root cause is missing input bounds in the stream and object parsing routines. The fix in commit 18bd298 introduces explicit array_maximum_element_count and dictionary_maximum_element_count configuration limits, each defaulting to 100_000, and adds a StreamParsingBudget abstraction to cap total parsing work.

Attack Vector

Exploitation requires an application to parse an attacker-supplied PDF. The attack is remotely triggerable in any workflow that accepts user-uploaded PDFs, such as document conversion services, mail gateways, e-discovery pipelines, or AI document ingestion stacks. No authentication or code execution primitive is required to trigger the memory blowup.

python
# Security patch in pypdf/_configuration.py
# SEC: Limit stream parsing work (#4218)

    """The maximum allowed declared ``/Length`` value for streams."""
    array_based_stream_maximum_output_length: int = 75_000_000
    """The maximum allowed output length for array-based streams."""
    array_maximum_element_count: int = 100_000
    """The maximum allowed number of elements inside an array."""
    dictionary_maximum_element_count: int = 100_000
    """The maximum allowed number of key-value pairs inside a dictionary."""

    jbig2_maximum_output_length: int = 75_000_000

Source: GitHub Commit 18bd298

python
# Security patch in pypdf/generic/__init__.py introducing StreamParsingBudget
from ._outline import OutlineItem
from ._rectangle import RectangleObject
from ._utils import (
    StreamParsingBudget,
    create_string_object,
    decode_pdfdocencoding,
    hex_to_rgb,
)

Source: GitHub Commit 18bd298

Detection Methods for CVE-2026-113790

Indicators of Compromise

  • Python processes using pypdf showing sudden, sustained memory growth followed by MemoryError or OOM-killer termination.
  • PDF uploads whose uncompressed object streams contain arrays or dictionaries with tens of thousands or more elements.
  • Repeated submissions of small PDFs that trigger disproportionately large resident memory in the parsing worker.

Detection Strategies

  • Inventory applications and container images for pypdf versions earlier than 6.21.0 using software composition analysis.
  • Instrument PDF parsing workers to record peak memory and parse duration per document, and alert on statistical outliers.
  • Add structural PDF validation at the edge to reject documents whose object counts exceed reasonable thresholds before they reach pypdf.

Monitoring Recommendations

  • Monitor cgroup or container memory limits on PDF processing workloads and alert on repeated OOM events.
  • Track crash loops and restart counts for services such as document converters, OCR pipelines, and mail scanners that call pypdf.
  • Correlate PDF upload events with worker termination events in your SIEM to identify targeted abuse.

How to Mitigate CVE-2026-113790

Immediate Actions Required

  • Upgrade pypdf to version 6.21.0 or later across all applications, containers, and virtual environments.
  • Audit dependency manifests (requirements.txt, pyproject.toml, Pipfile.lock) and rebuild images that pin older versions.
  • Enforce per-process memory limits on any worker that parses untrusted PDFs so a single document cannot exhaust host memory.

Patch Information

The fix is delivered in pypdf 6.21.0 and documented in GitHub Security Advisory GHSA-f54x-cmq8-qg57. The underlying code changes are tracked in Pull Request #4218 and commit 18bd298, which introduce array_maximum_element_count, dictionary_maximum_element_count, and the StreamParsingBudget guard.

Workarounds

  • Run PDF parsing in isolated worker processes with hard memory limits (for example, ulimit -v or Kubernetes resource limits) so OOM conditions do not affect other workloads.
  • Reject PDF uploads above a defined file-size threshold and perform lightweight structural checks before invoking pypdf.
  • If upgrading is not immediately possible, review pypdf.generic tunables after upgrade and lower the default element-count limits to values appropriate for your workload.
bash
# 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

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.