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-113795 Overview
CVE-2026-113795 is a resource exhaustion vulnerability [CWE-400] in pypdf, a free and open-source pure-Python PDF library. Versions prior to 6.20.0 fail to limit the number of filters applied to a PDF stream or the cumulative volume of data those filters process. An attacker who supplies a crafted PDF can trigger large memory consumption during stream decoding, leading to denial of service in applications that parse untrusted PDF input. The maintainers addressed the issue in pypdf 6.20.0 by introducing configurable limits on filter count and accumulated decoding work.
Critical Impact
Processing a single crafted PDF can exhaust available memory in server-side PDF ingestion pipelines, crashing the host process and disrupting dependent services.
Affected Products
- pypdf versions prior to 6.20.0
- Python applications and services that parse untrusted PDF content with pypdf
- Downstream libraries and web services that embed pypdf for extraction, rendering, or conversion workflows
Discovery Timeline
- 2026-10-21 - CVE-2026-113795 published to NVD
- 2026-10-22 - Last updated in NVD database
Technical Details for CVE-2026-113795
Vulnerability Analysis
The vulnerability resides in pypdf's stream decoding path. PDF stream objects can declare one or more filters (for example FlateDecode, ASCII85Decode, LZWDecode) that are applied sequentially to transform the raw stream data. Prior to 6.20.0, the library placed no upper bound on either the number of filters chained on a single stream or the cumulative size of intermediate decoding buffers.
An attacker can construct a PDF whose stream dictionary lists a large array of filters, or a smaller chain of filters that each expand their input substantially. When pypdf iterates through the filter chain, each stage allocates buffers for its decoded output, and intermediate results accumulate in memory. The process memory footprint grows until the host exhausts available RAM or the OS kills the process.
This is a classic uncontrolled resource consumption pattern. Exploitation does not require authentication, and the attack surface includes any service that accepts user-supplied PDFs, such as document converters, ticketing systems, email gateways, and content indexers.
Root Cause
The root cause is missing input validation on two attributes of a PDF stream: the length of the FILTER array and the aggregate size of decoded output across chained filters. Without guardrails, a malformed PDF can direct pypdf into unbounded buffer allocation during the decode loop in pypdf/filters.py.
Attack Vector
Delivery is over the network through any workflow that passes an untrusted PDF to pypdf. User interaction is limited to submitting the file. No credentials are required. The impact is restricted to availability; confidentiality and integrity are not affected.
# Patch excerpt from pypdf/_configuration.py introducing new limits
image_maximum_buffer_size: int = 75_000_000
"""The maximum allowed number of bytes to allocate for images."""
stream_filters_maximum_length: int = 16
"""The maximum allowed number of filters per stream."""
stream_decoding_work_maximum_length: int = 300_000_000
"""The maximum allowed accumulated decoding work in bytes per stream."""
xmp_maximum_input_length: int = 5_000_000
"""The maximum allowed actual decompressed stream length in bytes for XMP data."""
xmp_maximum_element_count: int = 100_000
Source: GitHub Commit 80a84d4
# Patch excerpt from pypdf/filters.py enforcing the new limits
configuration = get_configuration()
filters = stream.get(StreamAttributes.FILTER, ())
if isinstance(filters, IndirectObject):
filters = cast(ArrayObject, filters.get_object())
if not isinstance(filters, ArrayObject):
# We have a single filter instance
filters = (filters,)
if (filter_count := len(filters)) > configuration.stream_filters_maximum_length:
raise LimitReachedError(
f"Maximum filter count {configuration.stream_filters_maximum_length} exceeded: {filter_count}"
)
decode_parms = stream.get(StreamAttributes.DECODE_PARMS, (DictionaryObject(),) * len(filters))
if not isinstance(decode_parms, (list, tuple)):
decode_parms = (decode_parms,)
data: bytes = stream._data
if not data:
return data
accumulated_decoding_work = 0
decoding_work_maximum_length = configuration.stream_decoding_work_maximum_length
def _check_decoding_work(amount: int) -> None:
nonlocal accumulated_decoding_work
accumulated_decoding_work += amount
if accumulated_decoding_work > decoding_work_maximum_length:
Source: GitHub Commit 80a84d4
Detection Methods for CVE-2026-113795
Indicators of Compromise
- Python processes importing pypdf showing sudden resident memory growth into the hundreds of megabytes or more while parsing a single document.
- Repeated MemoryError exceptions or OOM-killer events on hosts running PDF ingestion services.
- PDF files whose stream dictionaries contain unusually long /Filter arrays or deeply chained filter pipelines.
Detection Strategies
- Inventory Python dependencies across build artifacts and container images to identify installations of pypdf at versions below 6.20.0.
- Instrument PDF parsing workflows with per-request memory and CPU accounting, and alert when a single document exceeds expected thresholds.
- Pre-scan incoming PDFs with a lightweight parser that counts /Filter entries per stream and quarantines files that exceed a configured maximum.
Monitoring Recommendations
- Track process-level RSS and OOM-kill events for services that parse user-supplied PDFs, and feed those metrics into your SIEM.
- Correlate upload events with downstream worker crashes to identify repeat offenders or scripted abuse.
- Monitor dependency manifests (requirements.txt, pyproject.toml, SBOMs) in CI to flag any regression to a vulnerable pypdf version.
How to Mitigate CVE-2026-113795
Immediate Actions Required
- Upgrade pypdf to version 6.20.0 or later in all environments that process untrusted PDFs.
- Rebuild and redeploy container images, serverless functions, and virtual environments that pin an older pypdf release.
- Place resource limits (memory ceilings, timeouts, worker isolation) around any process that invokes pypdf on externally sourced input.
Patch Information
The fix is included in pypdf release 6.20.0 via the changes in pull request #4173. The patch adds two configurable guards, stream_filters_maximum_length (default 16) and stream_decoding_work_maximum_length (default 300_000_000 bytes), and raises LimitReachedError when a stream exceeds either bound. Full technical context is available in GHSA-7mh2-4gg2-979f.
Workarounds
- Run pypdf parsing inside a subprocess or container with a hard memory cgroup limit so that exhaustion kills only the worker, not the parent service.
- Reject PDFs above a reasonable size threshold at the ingestion boundary before they reach the parser.
- Pre-validate uploads with a minimal PDF structural scanner that enforces a cap on /Filter array length per stream.
# Upgrade pypdf to the fixed release
pip install --upgrade "pypdf>=6.20.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

