pypdf, LZWDecode Denial-of-Service, CVE-2025-45421 (Moderate)

Listen to this Post

How the mentioned CVE works:

The vulnerability CVE-2025-45421 exploits the LZW decompression algorithm within pypdf. A maliciously crafted PDF file can contain a compressed stream using the LZWDecode filter that is designed to trigger excessive memory allocation during the decompression process. When pypdf processes this manipulated stream, the LZW algorithm enters a state where it continuously adds new codes to its internal dictionary without bounds. This causes the decompression routine to allocate increasingly large amounts of system RAM, leading to resource exhaustion. The attack does not require code execution but can cause the application to become unresponsive or crash, resulting in a Denial-of-Service condition. This occurs specifically during the parsing of a page’s content stream that utilizes this filter.
Platform: pypdf
Version: <6.1.3

Vulnerability : Memory Exhaustion

Severity: Moderate

date: 2025-10-22

Prediction: Patch Available

What Undercode Say:

`pdf_parser –file malicious.pdf –lzw-decode`

`cat payload.pdf | grep /Filter /LZWDecode`

`python -c “from pypdf import PdfReader; PdfReader(‘exploit.pdf’)”`

How Exploit:

Craft PDF with malicious LZW stream. Attacker embeds a specially designed LZW-compressed object within a PDF. The victim’s system parses the file using a vulnerable pypdf version. The decompression algorithm allocates memory exponentially, consuming all available RAM.

Protection from this CVE:

Upgrade to pypdf 6.1.3. Apply PR 3502 changes. Validate PDF inputs. Use resource limits.

Impact:

Application Denial-of-Service. High memory consumption. System instability.

🎯Let’s Practice Exploiting & Learn Patching For Free:

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top