PyPI: pypdf

CVE-2025-66019

Safety vulnerability ID: SFTY-20251124-08236

Safety legacy ID: pyup.io-81877

Affected versions of the pypdf package are vulnerable to Denial of Service (DoS) due to insufficient limiting of memory usage when decoding LZWDecode content streams. The pypdf.filters LZWDecode implementation allows attacker-controlled page content streams to be decompressed without an effective maximum output size, so a single highly compressed stream can expand to roughly 1 GB of in-memory data during parsing.

Created at: Oct 19, 2026Updated at: Oct 19, 2026

Overview

pypdf's LZWDecode streams be manipulated to exhaust RAM

Advisory

Affected versions of the pypdf package are vulnerable to Denial of Service (DoS) due to insufficient limiting of memory usage when decoding LZWDecode content streams. The pypdf.filters LZWDecode implementation allows attacker-controlled page content streams to be decompressed without an effective maximum output size, so a single highly compressed stream can expand to roughly 1 GB of in-memory data during parsing.

Affected Package

Affecting pypdf package, versions<6.4.0

Also affects

---

How to Fix

Upgradepypdfto6.4.0or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more