CVE-2026-115585
Incomplete fix allows crafted cross‑reference streams to cause long runtimes.
- CVSS 7.1
- CWE-400
- Resource Management
- Remote
pypdf is a free and open-source pure-python PDF library. Prior to 6.21.2, an incomplete remediation for repeated malformed cross-reference entries in GHSA-55h5-xmcq-c37v could still trigger a complete PDF stream reload during each recovery attempt even when a recovery cache was present, causing crafted cross-reference streams to produce long runtimes. This issue is fixed in version 6.21.2.
- CWE
- CWE-400
- CVSS base score
- 7.1
- Published
- 2026-10-23
- OWASP
- A05 Security Misconfiguration
- Orthogonal defect classification
- Timing/Serialization
- Code defect classification
- Timing Issues
- Category
- Resource Management
- Subcategory
- Resource Exhaustion
- Accessibility scope
- Remote
- Impact
- Denial of Service (DoS)
- Affected component
- pypdf
- Fixed by upgrading
- Yes
Solution
Upgrade pypdf to version 6.21.2 or later.
Vulnerable code sample
import sys
from pypdf import PdfReader
def extract_titles(pdf_path: str) -> list[str]:
# VULNERABLE: repeated recovery attempts cause exhaustive reloads
reader = PdfReader(pdf_path) # default recovery_cache=False leads to repeated reloads on malformed xref
titles = []
for page in reader.pages:
if "/Title" in page.metadata:
titles.append(page.metadata["/Title"])
return titlesPatched code sample
import sys
from pypdf import PdfReader
def extract_titles(pdf_path: str) -> list[str]:
# FIX: enable recovery cache to avoid repeated reloads
reader = PdfReader(pdf_path, recovery_cache=True)
titles = []
for page in reader.pages:
if "/Title" in page.metadata:
titles.append(page.metadata["/Title"])
return titlesPublished fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- SEC: Avoid repeated full file loads (#4240) (py-pdf/pypdf)
pypdf/_doc_common.py · PdfDocCommon._replace_object,pypdf/_reader.py,pypdf/_reader.py · PdfReader.get_object,pypdf/_reader.py · PdfReader._read_standard_xref_table,pypdf/_utils.py
Cite this entry
@misc{vaitp:cve2026115585,
title = {{Incomplete fix allows crafted cross‑reference streams to cause long runtimes.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-115585},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-115585/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
