CVE-2026-54530: pypdf Infinite Loop DoS Vulnerability – Patch to 6.13.0
pypdf, a widely-used open-source Python PDF library, contains a flaw that allows an attacker to create a specially crafted PDF file capable of causing an application to hang indefinitely. The vulnerability is triggered when the application attempts to extract text from the PDF in layout mode. This is a denial-of-service condition—the application becomes unresponsive but no data is stolen or corrupted. The flaw has been patched in version 6.13.0.
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 extracting the text in layout mode. 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-54530 is an infinite loop vulnerability (CWE-835) in pypdf prior to version 6.13.0. The defect is present in the text extraction logic when operating in layout mode. A maliciously constructed PDF can cause the text extraction routine to enter an infinite loop, consuming CPU resources and blocking execution. The vulnerability requires local access and user interaction (launching text extraction), but once triggered, causes a complete denial of service for the affected process.
Business impact
Organizations relying on pypdf for automated PDF processing, document management systems, or batch text extraction face service disruption risks. If pypdf is embedded in server applications or background workers, a crafted PDF could cause worker threads to hang, degrading system responsiveness or causing task queues to back up. The denial-of-service nature means availability is compromised, but confidentiality and integrity are not at risk. For critical document processing workflows, this could impact SLA compliance and user-facing services.
Affected systems
Any application or service using pypdf versions prior to 6.13.0 is vulnerable. This includes Python applications performing PDF text extraction in layout mode, as well as any third-party tools or web services that depend on this library. Organizations should inventory all internal and third-party dependencies on pypdf to identify exposure.
Exploitability
Exploitation requires an attacker to deliver a malicious PDF to a target application and have that application perform text extraction in layout mode. The attack does not require elevated privileges or network access—a local or web-submitted file will trigger the vulnerability. However, the attacker must know or guess that layout mode text extraction will be performed. The bar for weaponization is moderate; automated detection of vulnerable applications is possible, but targeted attacks would likely require some reconnaissance of deployed pypdf configurations.
Remediation
Update pypdf to version 6.13.0 or later. Organizations should treat this as a standard maintenance update for open-source dependencies. Verify the update in your package management system (pip, poetry, etc.) and perform regression testing on text extraction workflows. For applications that cannot be immediately updated, temporary mitigation includes disabling layout mode text extraction or restricting PDF input to trusted sources.
Patch guidance
Upgrade pypdf to version 6.13.0 or newer via your package manager (e.g., 'pip install --upgrade pypdf'). Verify the installed version using 'pip show pypdf' and confirm version 6.13.0 or later. Test text extraction functionality after upgrade to ensure no breaking changes affect your application. For applications in production, consider a staged rollout with a development/staging environment test first. Review pypdf release notes for any additional changes in 6.13.0.
Detection guidance
Monitor for process hangs or high CPU usage correlated with PDF text extraction operations. Check application logs for incomplete or stalled extraction tasks. If using application performance monitoring (APM) or logging, look for text extraction calls that do not complete within expected timeframes. Vulnerability scanning tools should detect pypdf versions prior to 6.13.0 in dependency manifests (requirements.txt, poetry.lock, setup.py, pyproject.toml).
Why prioritize this
Although the CVSS score of 5.5 (MEDIUM) reflects the availability impact and local access requirement, the ease of exploitation and broad use of pypdf in document processing pipelines warrant prompt patching. This is not an emergency, but should be included in the next standard maintenance cycle. Organizations with PDF processing as a core service should prioritize this higher.
Risk score, explained
The CVSS 3.1 score of 5.5 reflects a Medium severity vulnerability with local attack vector, low complexity, and low privileges required, but with no confidentiality or integrity impact—only availability. The infinite loop causes denial of service rather than system compromise. The score does not account for business context; individual organizations may assess risk differently based on how critical PDF processing is to their operations.
Frequently asked questions
Does this vulnerability allow an attacker to steal data from a PDF or corrupt it?
No. CVE-2026-54530 causes only a denial of service (infinite loop). Confidentiality and integrity are not affected. The attacker cannot extract, modify, or view PDF contents beyond what the application already processes.
What is 'layout mode' and why does it matter?
Layout mode is a text extraction mode in pypdf that preserves spatial relationships and formatting of text as it appears visually in the PDF. Not all text extraction operations use this mode, so applications using other extraction methods may not be vulnerable. Review your application's configuration to confirm whether layout mode is enabled.
If we cannot upgrade pypdf immediately, what can we do?
Temporary mitigations include: (1) disabling layout mode text extraction if not critical to your workflow, (2) restricting PDF input to trusted internal sources only, or (3) implementing timeouts on text extraction operations to prevent indefinite hangs. However, patching to 6.13.0 is the recommended permanent solution.
Is this vulnerability being actively exploited?
This vulnerability is not listed in CISA's Known Exploited Vulnerabilities (KEV) catalog, meaning there is no confirmed public exploitation at this time. However, the relative simplicity of crafting a malicious PDF means organizations should not assume it will remain unexploited indefinitely.
This analysis is based on publicly available vulnerability data current as of June 2026. CVSS scores and severity ratings are provided by the CVE record and should be interpreted in the context of your organization's risk model and business processes. Version numbers and patch guidance are derived from official vendor advisories; verify compatibility with your environment before applying updates. This information is for informational purposes and does not constitute professional security advice. Consult your security team and vendor documentation for definitive remediation strategies. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-54531MEDIUMpypdf 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