pypdf's LZWDecode streams be manipulated to exhaust RAM
Description
Published to the GitHub Advisory Database
Nov 24, 2025
Reviewed
Nov 24, 2025
Published by the National Vulnerability Database
Nov 26, 2025
Last updated
Nov 27, 2025
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:
References