CVE-2026-102997: pypdf: Possible long runtimes for partially malformed FlateDecode streams (Follow-up)
Impact
An attacker who uses this vulnerability can craft a PDF which leads to long runtimes. This requires a partially malformed /FlateDecode stream, where the byte-by-byte decompression is used.
Patches
This has been fixed in pypdf==6.18.1.
Workarounds
If you cannot upgrade yet, consider applying the changes from PR #4073.
Other sources
pypdf is a free and open-source pure-python PDF library. Prior to 6.18.1, a crafted PDF containing a partially malformed /FlateDecode stream with padded data can force pypdf/filters.py to use inefficient byte-by-byte decompression while the earlier recovery counter fails to advance for bytes that successfully decode, causing long runtimes and application unavailability. This is a residual issue after the malformed FlateDecode recovery fix. This issue is fixed in version 6.18.1.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/pypdfto a version that resolves this vulnerability.Fixed in 6.18.1 - Upgrade
Upgrade
pypdfto a version that resolves this vulnerability.Fixed in 6.18.1
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Deployments using pypdf versions prior to 6.18.1 may be affected if they process attacker-controlled PDFs. The impact is application unavailability caused by long processing times.
What must an attacker provide to trigger the long runtime?
An attacker must cause the application to process a crafted PDF containing a partially malformed /FlateDecode stream with padded data. The condition triggers inefficient byte-by-byte decompression.
Is an upgrade available, and what can be done if it cannot be applied immediately?
The issue is fixed in pypdf 6.18.1. If an immediate upgrade is not possible, apply the changes from PR #4073.