CVE-2026-115585: pypdf: Possible long runtimes for repeated malformed cross-reference entries (Follow-up)
pypdf before 6.21.2 can be forced into long runtimes by a PDF with repeated malformed cross-reference streams. An attacker who can get a PDF in front of your parser ties up CPU and stalls the job. Upgrade to pypdf 6.21.2. This is a follow-up to an earlier fix that left a gap.
Published Oct 23, 2026 · Analysis Nov 2, 2026
What an attacker can do
The earlier advisory, GHSA-55h5-xmcq-c37v, added a cache for cross-reference streams. The cache worked, but the code still loaded the whole stream again on each repeat. A crafted PDF that repeats malformed cross-reference streams therefore still makes the reader burn time, and the cost grows with each repeat.
The attacker needs no account and no code on your host. They only need to get a PDF to any service that opens it with pypdf, such as an upload form, a document pipeline, an indexer or an email attachment processor. The CVSS 4.0 vector marks user interaction as passive and impact as availability only, high.
The result is denial of service. A worker or request thread runs for a long time on one file. Several such files can exhaust a worker pool. The advisory reports no confidentiality or integrity impact and no code execution. CWE-400 and CWE-407 describe the cause: uncontrolled resource use through an inefficient algorithm.
Who is affected
All pypdf releases below 6.21.2 are listed as vulnerable. Services that parse PDFs from untrusted sources carry the risk. Check the installed version:
pip show pypdfpypdf
- Ecosystem
- PyPI
- Affected
- < 6.21.2
- Fixed in
- 6.21.2
- Check
pip show pypdf
How to fix it
Upgrade to pypdf 6.21.2:
pip install --upgrade "pypdf==6.21.2"If you cannot upgrade yet, the advisory suggests applying the changes from pull request 4240 to your copy. As a general guard, also run PDF parsing under a time limit.
How to tell if you were hit
Look for PDF-processing workers that run far longer than usual, with a single CPU core pinned and request timeouts on upload or conversion endpoints. Keep the offending file and check whether it contains several cross-reference streams. Inventory every Python environment with pip show pypdf or pip list to find vulnerable installs.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Impact
An attacker who uses this vulnerability can craft a PDF which leads to long runtimes. This requires cross-reference streams with repeated malformed cross-reference streams.
Patches
This has been fixed in pypdf==6.21.2.
Workarounds
If you cannot upgrade yet, consider applying the changes from PR #4240.
Notes
This is a follow-up to https://github.com/py-pdf/pypdf/security/advisories/GHSA-55h5-xmcq-c37v, which had the side-effect of still loading the whole stream again despite the cache being present.
Credited to kyrux29, loegaire, stefan6419846.
Questions
- Which pypdf version fixes this?
pypdf 6.21.2. Every version below it is listed as vulnerable in the advisory.
- Is this the same as GHSA-55h5-xmcq-c37v?
No, it is a follow-up. The earlier fix added a cache but the code still reloaded the whole stream despite the cache being present, so long runtimes remained possible.
- Can this lead to code execution?
No. The advisory describes only long runtimes. The CVSS vector shows availability impact and none on confidentiality or integrity.
- Is there a workaround?
The advisory says to consider applying the changes from pypdf pull request 4240 if you cannot upgrade.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-119203
pypdf has possible infinite loop when hitting EOF in standard xref table during trailer search
high7.1Oct 30, 2026CVE-2026-119204
pypdf has possible large memory usage when parsing page tree
high7.1Oct 30, 2026CVE-2026-119205
pypdf has possible infinite loop when cloning dictionaries
high7.1Oct 30, 2026CVE-2026-119206
pypdf has possible long runtimes when retrieving page labels
high7.1Oct 30, 2026CVE-2026-119207
pypdf has possible large memory usage for exceptions in strict mode
high7.1Oct 30, 2026CVE-2026-119208
pypdf has possible long runtimes/large memory usage for encrypted PDF files
high7.1Oct 30, 2026
