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 package | Versions | Reported by |
|---|---|---|
| py-pdf pypdf | < 6.0.0, before 6.0.0 | CVE List, NVD |
| pypdf (PyPI) | before 6.0.0 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| GitHub_M | 6.6medium CVSS:4.0 | 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 |
| GitHub | medium CVSS:4.0 | 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 |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| PyPA Advisory Database | Not scored CVSS:4.0 | 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 |
Classification
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
| https://github.com/py-pdf/pypdf/security/advisories/GHSA-7hfw-26vp-jp8m | mitigation, third-party-advisory, web | |
| https://github.com/py-pdf/pypdf/issues/3429 | issue-tracking, web | |
| https://github.com/py-pdf/pypdf/pull/3430 | patch, web | |
| https://github.com/py-pdf/pypdf/blob/0dd57738bbdcdb63f0fb43d8a6b3d222b6946595/pypdf/filters.py#L72-L143 | product, web | |
| https://github.com/py-pdf/pypdf/releases/tag/6.0.0 | release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2025-55197 | advisory | |
| https://github.com/py-pdf/pypdf | package | |
| https://pypi.org/project/pypdf | package | |
| https://github.com/advisories/GHSA-7hfw-26vp-jp8m | advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-55197 changed 2025-08-14 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-7hfw-26vp-jp8m changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2025-55197 changed 2026-11-02 | Public domain |
| PyPA Advisory Database | PYSEC-2026-1830 changed 2026-07-07 | CC-BY-4.0 |