Skip to content

Manipulated LZWDecode streams can exhaust RAM - Follow-up

Moderate
stefan6419846 published GHSA-m449-cwjh-6pw7 Nov 23, 2025

Package

pip pypdf (pip)

Affected versions

< 6.4.0

Patched versions

>= 6.4.0

Description

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 you cannot upgrade yet, use

pypdf.filters.LZW_MAX_OUTPUT_LENGTH = 75_000_000

to overwrite the default in your code.

Severity

Moderate

CVE ID

CVE-2025-66019

Weaknesses

No CWEs

Credits