CVE-2026-54531: pypdf Infinite Loop DoS Vulnerability – Patch to 6.13.0
pypdf, a popular open-source Python PDF processing library, contains a flaw that allows an attacker to create a specially crafted PDF file that triggers an infinite loop when that file is merged with outlines (hierarchical document structure metadata) into a writer object. An attacker would need local access to the system and the ability to influence which PDFs are processed, making this a localized denial-of-service risk rather than a remote attack vector. The issue is resolved in pypdf version 6.13.0 and later.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 5.5 MEDIUM · CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- Weaknesses (CWE)
- CWE-835
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-22 / 2026-06-25
NVD description (verbatim)
pypdf is a free and open-source pure-python PDF library. Prior to 6.13.0, an attacker who uses this vulnerability can craft a PDF which leads to an infinite loop. This requires merging a file with outlines into a writer. This vulnerability is fixed in 6.13.0.
3 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
CVE-2026-54531 is an infinite loop vulnerability (CWE-835) in pypdf prior to version 6.13.0. The flaw occurs during PDF merging operations when a source file containing outlines (document structure/bookmarks) is written to an output writer. The vulnerability is triggered by a specific sequence: merging a PDF with populated outline data initiates uncontrolled recursion or iteration that does not terminate, causing the process to consume CPU and eventually hang or crash. The attack surface is limited to applications that directly call pypdf's merge functionality on untrusted PDF input.
Business impact
Organizations using pypdf in automated PDF processing pipelines face potential service disruption. A malicious or corrupted PDF could halt batch processing jobs, delay document workflows, or consume server resources unexpectedly. The impact is primarily availability-focused; there is no data exposure or integrity compromise. For applications that process user-supplied PDFs (document management systems, conversion services, report generators), this becomes a denial-of-service vector that could disrupt normal operations until the process is killed and restarted.
Affected systems
pypdf versions prior to 6.13.0 are affected. Any application or service that depends on pypdf for PDF manipulation—including custom scripts, web applications, document processing platforms, and automation tools—is at risk if they accept or merge PDFs with outline data. Python environments across Windows, macOS, and Linux are potentially vulnerable. The vulnerability requires an attacker to supply or influence the PDF input being processed.
Exploitability
Exploitability is moderate but dependent on context. An attacker needs local or application-level access to provide the malicious PDF to the affected system. The attack does not require special privileges, complex configuration, or system-level access once the malicious file reaches the processing queue. The barrier to entry is low—crafting a PDF with outlines is straightforward. However, real-world impact is limited to environments where untrusted PDFs are regularly processed or where user-supplied PDF uploads are a core feature.
Remediation
Upgrade pypdf to version 6.13.0 or later. This is a straightforward patch release with no breaking changes noted. Organizations should prioritize this update in development and test environments first to ensure compatibility with existing PDF workflows, then roll out to production systems systematically.
Patch guidance
Update pypdf using your package manager (pip install --upgrade pypdf or equivalent in your dependency management tool). Verify the installed version is 6.13.0 or later by running 'pip show pypdf' or checking your application's dependency manifest. If pypdf is pinned in your requirements.txt or lock file, update the version constraint and regenerate lock files. Test PDF merging operations in a staging environment before deploying to production to confirm no regressions in document output.
Detection guidance
Monitor for hung or zombie Python processes that are executing pypdf merge operations, especially when processing documents from external or untrusted sources. Look for elevated CPU usage on threads running PDF merge code. If you maintain application logs, search for timeout errors or incomplete PDF merge operations. Network-based detection is not applicable since this is a local processing vulnerability. Implement input validation to reject PDFs with suspicious or malformed outline structures before they reach pypdf processing steps.
Why prioritize this
While the CVSS score of 5.5 (MEDIUM) reflects the availability impact and local-access requirement, prioritize this vulnerability based on your organization's exposure: if you operate a document processing service, bulk PDF conversion, or accept user uploads, treat this as higher priority. If pypdf is an internal dependency with tightly controlled input, the practical risk is lower. The fact that this is not yet in CISA's Known Exploited Vulnerabilities catalog suggests active exploitation is not widespread, but the straightforward patch path argues for rapid deployment.
Risk score, explained
The CVSS 3.1 score of 5.5 reflects a MEDIUM severity vulnerability with high availability impact (A:H) but strictly local attack vector (AV:L) and low privileges (PR:L). There is no confidentiality or integrity compromise (C:N, I:N), which prevents a higher score. The score correctly penalizes this as a denial-of-service issue with limited remote exploitability, but organizations heavily dependent on uninterrupted PDF processing should consider their operational context when applying this score to their risk models.
Frequently asked questions
Does this vulnerability allow remote code execution or data theft?
No. CVE-2026-54531 is strictly a denial-of-service vulnerability that causes an infinite loop, consuming CPU and halting the PDF merge process. It does not permit code execution, data exfiltration, or privilege escalation. The impact is limited to availability.
Can this be exploited over the network?
Exploitation requires the attacker to supply the malicious PDF to the system executing pypdf. In web applications or APIs that accept file uploads, this could be achieved remotely by uploading a crafted file. However, the vulnerability itself does not involve network communication; the attack surface is the PDF parsing and merge logic.
What if we do not use pypdf's merge functionality?
If your application only uses pypdf for reading, extracting text, or other operations that do not invoke the merge function with outline-containing PDFs, your exposure is significantly reduced. Review your codebase to confirm which pypdf functions are in use. That said, upgrading to 6.13.0 remains the safest approach to eliminate the issue entirely.
Is there a workaround if we cannot upgrade immediately?
Implement input validation to detect PDFs with complex outline structures and reject them or process them without merging. Alternatively, run PDF merge operations in isolated, ephemeral processes with resource limits (CPU and memory caps) so a hung process does not cascade to other services. However, these are temporary mitigations; upgrading to 6.13.0 is the proper fix.
This analysis is provided for informational and risk assessment purposes. Organizations should verify all patch versions, affected product ranges, and remediation steps directly with the pypdf project advisory and their own vendor documentation before deploying changes to production systems. The vulnerability data herein reflects the state as of the publication date; organizations are responsible for monitoring for further updates or related issues. No warranty is made regarding the completeness or accuracy of this analysis in all operational contexts. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-54530MEDIUMpypdf Infinite Loop DoS Vulnerability – Patch to 6.13.0
- CVE-2026-54651MEDIUMpypdf Infinite Loop Denial of Service Vulnerability
- CVE-2026-10028MEDIUMglib-networking GnuTLS Certificate Validation Denial-of-Service
- CVE-2026-41150MEDIUMMermaid Gantt Chart DoS via Excludes Attribute
- CVE-2026-44740MEDIUMBilly Go Library Denial-of-Service via Input Validation Flaws
- CVE-2026-46146MEDIUMLinux Kernel USB Audio Infinite Loop DoS Vulnerability
- CVE-2026-46314MEDIUMLinux Kernel DRM v3d Infinite Loop DoS Vulnerability
- CVE-2026-46521MEDIUMImageMagick LZMA Out-of-Bounds Write – Patch & Detection Guide