2.7low
pypdf has possible long runtimes for malformed startxref
- Severity
- 2.7low CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.43% (higher than 39% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-4f6g-68pf-7vhvPYSEC-2026-1828
Description
pypdf is a free and open-source pure-python PDF library. Prior to version 6.6.0, pypdf has possible long runtimes for malformed startxref. An attacker who uses this vulnerability can craft a PDF which leads to possibly long runtimes for invalid startxref entries. When rebuilding the cross-reference table, PDF files with lots of whitespace characters become problematic. Only the non-strict reading mode is affected. Only the non-strict reading mode is affected. This issue has been patched in version 6.6.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| py-pdf pypdf | < 6.6.0, before 6.6.0 | CVE List, NVD |
| pypdf (PyPI) | before 6.6.0 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| GitHub_M | 2.7low CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U |
| GitHub | low CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U |
| NVD | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| 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:L/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.6.0, pypdf has possible long runtimes for malformed startxref. An attacker who uses this vulnerability can craft a PDF which leads to possibly long runtimes for invalid startxref entries. When rebuilding the cross-reference table, PDF files with lots of whitespace characters become problematic. Only the non-strict reading mode is affected. Only the non-strict reading mode is affected. This issue has been patched in version 6.6.0.
GitHub Advisory Database
Impact
An attacker who exploits this vulnerability can craft a PDF which leads to possibly long runtimes for invalid startxref entries. When rebuilding the cross-reference table, PDF files with lots of whitespace characters become problematic. Only the non-strict reading mode is affected.
Patches
This has been fixed in pypdf==6.6.0.
Workarounds
from pypdf import PdfReader, PdfWriter
# Instead of
reader = PdfReader("file.pdf")
# use the strict mode:
reader = PdfReader("file.pdf", strict=True)
# Instead of
writer = PdfWriter(clone_from="file.pdf")
# use an explicit strict reader:
writer = PdfWriter(clone_from=PdfReader("file.pdf", strict=True))
Resources
This issue has been fixed in #3594.
NVD (es)
pypdf es una biblioteca PDF de Python puro, gratuita y de código abierto. Antes de la versión 6.6.0, pypdf presenta posibles tiempos de ejecución prolongados para 'startxref' malformados. Un atacante que utiliza esta vulnerabilidad puede crear un PDF que provoca posibles tiempos de ejecución prolongados para entradas 'startxref' no válidas. Al reconstruir la tabla de referencias cruzadas, los archivos PDF con muchos caracteres de espacio en blanco se vuelven problemáticos. Solo el modo de lectura no estricto se ve afectado. Solo el modo de lectura no estricto se ve afectado. Este problema ha sido parcheado en la versión 6.6.0.
References
| https://github.com/py-pdf/pypdf/security/advisories/GHSA-4f6g-68pf-7vhv | mitigation, vendor-advisory, web | |
| https://github.com/py-pdf/pypdf/pull/3594 | issue-tracking, patch, web | |
| https://github.com/py-pdf/pypdf/commit/294165726b646bb7799be1cc787f593f2fdbcf45 | patch, web | |
| https://github.com/py-pdf/pypdf/releases/tag/6.6.0 | release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-22691 | advisory | |
| https://github.com/py-pdf/pypdf | package | |
| https://pypi.org/project/pypdf | package | |
| https://github.com/advisories/GHSA-4f6g-68pf-7vhv | advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-22691 changed 2026-01-12 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-4f6g-68pf-7vhv changed 2026-07-07 | CC-BY-4.0 |
| NVD | CVE-2026-22691 changed 2026-11-02 | Public domain |
| PyPA Advisory Database | PYSEC-2026-1828 changed 2026-07-07 | CC-BY-4.0 |