pypdf's LZWDecode streams be manipulated to exhaust RAM
Impact
An attacker who uses this vulnerability can craft a PDF which leads to a memory usage of up to 1 GB per stream. This requires parsing the content stream of a page using the LZWDecode filter.
This is a follow up to GHSA-jfx9-29x2-rv3j to align the default limit with the one for zlib.
Patches
This has been fixed in pypdf==6.4.0.
Workarounds
If users cannot upgrade yet, use the line below to overwrite the default in their code:
pypdf.filters.LZW_MAX_OUTPUT_LENGTH = 75_000_000
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | pypdf | < 6.4.0 | 6.4.0 |
References
- https://github.com/py-pdf/pypdf/security/advisories/GHSA-jfx9-29x2-rv3j
- https://github.com/py-pdf/pypdf/security/advisories/GHSA-m449-cwjh-6pw7
- https://nvd.nist.gov/vuln/detail/CVE-2025-66019
- https://github.com/py-pdf/pypdf/commit/96186725e5e6f237129a58a97cd19204a9ce40b2
- https://aydinnyunus.github.io/2025/12/20/cve-2025-66019-pypdf-lzw-dos
- https://github.com/py-pdf/pypdf
- https://github.com/py-pdf/pypdf/releases/tag/6.4.0
- https://pypi.org/project/pypdf
- https://github.com/advisories/GHSA-m449-cwjh-6pw7
- CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:U- Weakness (CWE)
CWE-400, CWE-409- Platform
- Python (PyPI)
- Package
pypdf- Disclosed
- 24.11.2025
- Updated
- 11.10.2026 15:17
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2026-1832 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-m449-cwjh-6pw7 - CC BY 4.0
Vulnerability history: pypdf
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 51
- First → latest
- 06.2023 10.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 10
- Medium 38
- Low 3
Disclosures per year
- 2023: 2
- 2024: 0
- 2025: 4
- 2026: 45
-
pypdf's LZWDecode streams be manipulated to exhaust RAM this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.