CVE-2026-59937: pypdf Denial-of-Service via Malformed PDF Cross-Reference Streams
pypdf, a popular open-source Python library for PDF manipulation, contains a denial-of-service vulnerability in versions prior to 6.14.0. An attacker can create a specially crafted PDF file containing repeated malformed cross-reference streams that force pypdf into excessive processing loops while attempting to recover broken table entries. This causes the application to hang or consume CPU resources, effectively denying service to legitimate users. The vulnerability requires no authentication or user interaction—simply opening the malicious PDF triggers the issue.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Weaknesses (CWE)
- CWE-400
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-07-08 / 2026-07-09
NVD description (verbatim)
pypdf is a free and open-source pure-python PDF library. Prior to 6.14.0, an attacker can craft a PDF with repeated malformed cross-reference streams that cause pypdf to spend long runtimes recovering broken cross-reference table entries. This issue is fixed in version 6.14.0.
4 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
CVE-2026-59937 is a denial-of-service vulnerability stemming from improper handling of malformed cross-reference (xref) streams in PDF files. When pypdf encounters repeated xref stream anomalies, its error recovery mechanism enters a pathological state attempting to reconstruct broken entries, resulting in unbounded runtime. The root cause is classified under CWE-400 (Uncontrolled Resource Consumption), indicating that the library lacks adequate safeguards against algorithmic complexity attacks. The attack vector is network-based with low complexity; no special privileges or user interaction are required. The CVSS 3.1 score of 7.5 (HIGH) reflects high availability impact with no confidentiality or integrity compromise.
Business impact
Organizations and services using pypdf are at risk of service disruptions. Any automated PDF processing pipeline—invoice systems, document management, report generation, compliance workflows—can be halted by a single malicious PDF upload or attachment. This is particularly concerning for SaaS platforms, API services, and server-side PDF processing that handles untrusted user input. An attacker could exhaust CPU and memory on affected systems, causing cascading failures in dependent services. Cloud environments may incur unexpected resource costs due to sustained high utilization.
Affected systems
pypdf versions prior to 6.14.0 are vulnerable. This includes any application, service, or workflow that directly or indirectly depends on pypdf for PDF parsing or manipulation. The library is used in document management systems, data extraction tools, and PDF processing microservices. If your environment includes pypdf as a dependency (check requirements.txt, Pipfile, or pyproject.toml), you are potentially exposed.
Exploitability
Exploitability is straightforward. An attacker with the ability to introduce a crafted PDF into a system running vulnerable pypdf—via email attachment, web upload, API submission, or document sharing—can trigger the denial-of-service condition. No special tools, credentials, or reverse-engineering are needed; only a malicious PDF file. The vulnerability does not require social engineering if the PDF processing is automatic. This makes it a practical risk in any environment accepting PDF files from untrusted sources.
Remediation
Upgrade pypdf to version 6.14.0 or later. This patch addresses the malformed xref stream handling and implements resource consumption controls. Verify the upgrade by confirming the installed version using pip show pypdf. For applications unable to upgrade immediately, consider implementing PDF validation or sandboxing: reject PDFs exceeding size thresholds, process PDFs in isolated containers with resource limits (CPU/memory caps), or disable automatic PDF processing from untrusted sources pending patching.
Patch guidance
1. Identify all systems and applications using pypdf by reviewing dependency files and package management logs. 2. Test pypdf 6.14.0 in a non-production environment to ensure compatibility with your application. 3. Deploy the upgrade via your standard deployment pipeline, updating requirements.txt or equivalent to pin pypdf>=6.14.0. 4. Verify successful upgrade by running pip show pypdf and confirming version 6.14.0 or later. 5. Monitor error logs for any anomalies post-deployment. 6. Document the patch in your change management system and security incident log.
Detection guidance
Monitor for indicators of exploitation: sustained high CPU usage correlating with PDF processing events, application hangs or timeouts during PDF ingestion, memory usage spikes tied to document uploads, and repeated warnings or errors in pypdf logs related to cross-reference stream recovery. Implement logging on PDF file receipt (name, size, source) and correlate with performance degradation. Consider deploying file integrity monitoring on systems processing PDFs. In logs, look for patterns where a single PDF submission precedes system resource exhaustion. Network-level detection is limited since the malicious PDF is the payload itself; emphasis should be on endpoint and application-level visibility.
Why prioritize this
Although this vulnerability has a HIGH CVSS score and network accessibility, it is not yet listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, indicating limited real-world exploitation evidence at publication. However, the ease of exploitation, broad applicability of pypdf, and direct impact on availability warrant prompt attention. Organizations processing PDFs from untrusted sources should prioritize patching within their standard update cadence (typically 1–4 weeks). Those accepting arbitrary PDF uploads should escalate to high priority and patch within 1–2 weeks.
Risk score, explained
The CVSS 3.1 score of 7.5 (HIGH) reflects: network attack vector (AV:N) — no special access required; low attack complexity (AC:L) — no special conditions; no privilege requirement (PR:N); no user interaction needed (UI:N); availability impact is high (A:H) — services are degraded or unavailable. Confidentiality and integrity are unaffected (C:N, I:N), limiting the score. The HIGH severity is appropriate given the ease of exploitation and potential for service disruption, though the lack of data breach risk prevents a CRITICAL rating.
Frequently asked questions
Can pypdf be safely used for untrusted PDFs before patching?
No. If your application processes PDFs from untrusted sources (user uploads, email, third-party APIs), vulnerable versions are at direct risk. Consider implementing a resource-limited sandbox (container with CPU/memory caps, timeout enforcement) as a temporary mitigation, but upgrade to 6.14.0 as soon as possible.
Does this vulnerability affect pypdf4 or older pypdf forks?
This CVE specifically addresses pypdf versions prior to 6.14.0. If your codebase uses older forks (e.g., PyPDF2, pypdf4), verify whether they have separate patches. Always check the official pypdf project repository for applicability.
What happens if a malicious PDF reaches our system?
pypdf will enter a recovery loop attempting to parse the malformed cross-reference streams, consuming CPU and memory. The application may hang, timeout, or crash. Dependent services may also degrade or fail if they rely on timely responses from the PDF processor.
Is there a way to detect if a PDF is malicious without opening it?
Not reliably. Malicious PDFs may be structurally similar to legitimate ones; detection requires parsing. Pre-upload validation (size limits, file type verification) offers minimal protection. Your best defense is patching and monitoring resource consumption during PDF processing.
This analysis is provided for informational purposes and reflects publicly available information as of the publication date. CVE-2026-59937 is not yet listed in the CISA KEV catalog. Organizations should verify patch applicability and test in their environment before deployment. SEC.co does not provide legal advice; consult your security and compliance teams for organizational impact assessment. Always refer to official vendor advisories and release notes for authoritative patch guidance. Source: NVD (public-domain), retrieved 2026-08-17. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-59936HIGHpypdf Infinite Loop Denial of Service Vulnerability (6.14.1)
- CVE-2026-48155MEDIUMpypdf Denial of Service via Malicious PDF Memory Exhaustion
- CVE-2026-49461MEDIUMpypdf Memory Exhaustion Vulnerability – Patch to 6.12.2
- CVE-2026-57204MEDIUMpypdf Denial-of-Service Memory Exhaustion Vulnerability
- CVE-2023-54365HIGHTraefik HTTP/2 Denial of Service Vulnerability – Rapid Reset Attack
- CVE-2024-14036HIGHDräger Core Denial of Service via Malformed SDC Messages
- CVE-2025-52293HIGHGPAC MP4Box HEVC Parser Denial of Service (CVSS 7.5)
- CVE-2025-53114HIGHCometD Denial-of-Service via Unacknowledged Message Queue Overflow