CVE-2025-55197
JSON

6.6medium

pypdf's Manipulated FlateDecode streams can exhaust RAM

Severity
6.6medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.54% (higher than 47% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-7hfw-26vp-jp8mPYSEC-2026-1830

Description

pypdf is a free and open-source pure-python PDF library. Prior to version 6.0.0, an attacker can craft a PDF which leads to the RAM being exhausted. This requires just reading the file if a series of FlateDecode filters is used on a malicious cross-reference stream. Other content streams are affected on explicit access. This issue has been fixed in 6.0.0. If an update is not possible, a workaround involves including the fixed code from pypdf.filters.decompress into the existing filters file.

Affected

Product or packageVersionsReported by
py-pdf pypdf< 6.0.0, before 6.0.0CVE List, NVD
pypdf (PyPI)before 6.0.0GitHub Advisory Database, PyPA Advisory Database

All scores

GitHub_M6.6medium CVSS:4.0CVSS: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
GitHubmedium CVSS:4.0CVSS: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
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
PyPA Advisory DatabaseNot scored CVSS:4.0CVSS: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

Classification

CWE-400CWE-770

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

pypdf is a free and open-source pure-python PDF library. Prior to version 6.0.0, an attacker can craft a PDF which leads to the RAM being exhausted. This requires just reading the file if a series of FlateDecode filters is used on a malicious cross-reference stream. Other content streams are affected on explicit access. This issue has been fixed in 6.0.0. If an update is not possible, a workaround involves including the fixed code from pypdf.filters.decompress into the existing filters file.

GitHub Advisory Database
Impact

An attacker who uses this vulnerability can craft a PDF which leads to the RAM being exhausted. This requires just reading the file if a series of FlateDecode filters is used on a malicious cross-reference stream. Other content streams are affected on explicit access.

Patches

This has been fixed in pypdf==6.0.0.

Workarounds

If you cannot upgrade yet, you might want to implement the workaround for pypdf.filters.decompress yourself: https://github.com/py-pdf/pypdf/blob/0dd57738bbdcdb63f0fb43d8a6b3d222b6946595/pypdf/filters.py#L72-L143

References

This issue has been reported in #3429 and fixed in #3430.

NVD (es)

Pypdf es una librería PDF gratuita y de código abierto basada en Python. Antes de la versión 6.0.0, un atacante podía manipular un PDF que agotaba la RAM. Esto solo requería leer el archivo si se utilizaban una serie de filtros FlateDecode en un flujo de referencia cruzada malicioso. Otros flujos de contenido se ven afectados con el acceso explícito. Este problema se ha corregido en la versión 6.0.0. Si no es posible actualizar, una solución alternativa consiste en incluir el código corregido de pypdf.filters.decompress en el archivo de filtros existente.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-55197 changed 2025-08-14CVE Terms of Use
GitHub Advisory DatabaseGHSA-7hfw-26vp-jp8m changed 2026-09-10CC-BY-4.0
NVDCVE-2025-55197 changed 2026-11-02Public domain
PyPA Advisory DatabasePYSEC-2026-1830 changed 2026-07-07CC-BY-4.0