CVE-2026-113791: pypdf content stream parsing can consume excessive memory

pypdf Updated 22 Oct 2026

Summary

22/10/2026
Yes i
Moderate
6.0

CVE-2026-113791: Crafted PDF files can cause excessive memory consumption during parsing, potentially exhausting resources and disrupting application availability. Affects pypdf versions < 6.21.0. Fixed in 6.21.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

pypdf is a Python package in the PyPI ecosystem for working with PDF files. Applications use it to parse and process PDF documents, including their content streams. This advisory concerns memory use while parsing streams containing many small operations, so applications that process PDFs may be exposed when they handle crafted documents.

Vulnerability Detail

A crafted PDF can cause excessive memory consumption when pypdf parses content streams containing many small operations, potentially exhausting resources and disrupting application availability. The issue is a resource exhaustion vulnerability associated with uncontrolled resource consumption. The affected range begins at the initial release and ends before the fixed release. The advisory identifies CWE-400 and CWE-770; it does not describe data disclosure or modification.

How To Fix

Latest published version: 6.21.2 as of 22 Oct 2026

pip install --upgrade "pypdf==6.21.2"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

6.21.0

This is the first release that contains the fix.

pip install --upgrade "pypdf==6.21.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

Documented workaround: pypdf users who cannot upgrade can consider applying the changes from PR #4218. The advisory does not provide a command or code snippet for applying those changes.

Conclusion

Upgrade pypdf to 6.21.0 to address the excessive memory use triggered by crafted PDF content streams. If an upgrade is not currently possible, the advisory points to PR #4218 as a documented workaround. Review applications that parse untrusted PDFs and confirm their dependency records. Vulert monitors the dependencies in Pipfile.lock and alerts when a new vulnerability affects them; check an application at https://vulert.com/scanner.

See every vulnerability recorded for pypdf →

Share this vulnerability

FAQ

pypdf versions from the initial release up to, but not including, 6.21.0 are affected by CVE-2026-113791.

An attacker can provide a crafted PDF that causes pypdf to use excessive memory while parsing content streams.

Upgrade pypdf to the minimum fixed version, 6.21.0, using the supplied package installation command.

Consider applying the documented changes from pypdf PR #4218 until you can upgrade to the fixed release.

Check Pipfile.lock manually for the pypdf dependency. Vulert can scan a manifest or SBOM and monitor the dependency at Vulert Scanner.

Related vulnerabilities

Recent vulnerabilities recorded for pypdf.

How To Fix

Latest published version: 6.21.2 as of 22 Oct 2026

pip install --upgrade "pypdf==6.21.2"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

6.21.0

This is the first release that contains the fix.

pip install --upgrade "pypdf==6.21.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback