CVE-2026-115580: pypdf: Possible long runtimes for large xref table header limits
pypdf can be pushed into very long runtimes by a PDF whose xref table header declares large or wrong upper limits. Any service that opens untrusted PDFs with pypdf can be stalled. Fixed in pypdf 6.21.2.
Published Oct 23, 2026 · Analysis Nov 2, 2026
What an attacker can do
A PDF's cross-reference (xref) table tells the reader where each object lives. The standard table starts with a header that gives the object range. If the header states a huge or incorrect upper limit, pypdf works through that range, and the run takes far longer than the file's size suggests. The advisory says the attacker needs the victim to open such a file. The 6.21.2 release notes list a security fix named "Limit size of standard xref table" (PR 4239), which is the patch the advisory points to for a workaround.
The crafted file can be tiny, because the cost comes from the declared numbers and not the content. An upload endpoint, a document-processing queue, a RAG indexer or a mail gateway that parses PDFs with pypdf can be tied up by a few requests. The CVSS 4.0 vector shows a network attack, no privileges, passive user interaction and an availability-only impact. Data stays safe.
Who is affected
pip package pypdf older than 6.21.2, in code that opens PDFs from untrusted sources, such as upload handlers or document ingestion jobs. Check the installed version with:
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"The advisory's interim workaround is to apply the changes from pull request 4239, which limits the size of the standard xref table. Set a hard timeout on PDF parsing jobs regardless.
How to tell if you were hit
Watch for parser processes stuck at high CPU on a single file. Check files that stalled the parser for an xref section whose header declares an object count far larger than the file could hold.
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 opening a file with large/wrong upper limits in the xref table.
Patches
This has been fixed in pypdf==6.21.2.
Workarounds
If you cannot upgrade yet, consider applying the changes from PR #4239.
Credited to ducanhmit, stefan6419846.
Questions
- What is the difference between CVE-2026-115580 and CVE-2026-115572?
This one comes from large or wrong limits in the xref table header. The other comes from repeated references to a single missing object. Both are availability bugs fixed in pypdf 6.21.2.
- Is there a workaround?
The advisory says to apply the changes from PR 4239 if you cannot upgrade. Upgrading is simpler.
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
