Skip to main content

pypdf EUVDEUVD-2026-38355

| CVE-2026-54531 MEDIUM
Loop with Unreachable Exit Condition (Infinite Loop) (CWE-835)
2026-06-16 https://github.com/py-pdf/pypdf GHSA-m2v9-299j-rv96
6.9
CVSS 4.0 · Vendor: https://github.com/py-pdf/pypdf
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft PDF with cyclic /Outlines or /Parent structure
  2. Delivery
    Submit PDF to merge-capable endpoint
  3. Exploit
    PdfWriter.merge() invokes _get_filtered_outline()
  4. Execution
    Cycle detection absent - loop runs indefinitely
  5. Persist
    CPU resource exhaustion in worker
  6. Impact
    Service denial for all users

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Loop termination conditions
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the target application runs pypdf version earlier than 6.13.0 AND calls PdfWriter.merge() (or an equivalent merge workflow) on a PDF supplied by the attacker. The cyclic /Outlines path is triggered when the merged PDF's outline tree contains a circular reference - e.g., a node whose /Next or /First entry resolves to an ancestor already visited. A second, independent code path in _layout_mode_fonts() is triggered by cyclic /Parent page-hierarchy references during layout-mode text extraction, which is a distinct feature and reachable via a different API call. Exploitation is strictly limited to these two merge/extraction workflows; reading, decrypting, or extracting text from a crafted PDF via non-layout paths does not trigger the loop. Applications that do not ingest untrusted PDF files, or that perform no merge operations, are not exposed.

Impact

No CVSS score or vector was provided by NVD or the reporting source, and no EPSS data is available, so all severity signals must be inferred. The vulnerability is not listed in CISA KEV, and no public POC exploit code has been identified beyond what can be derived from the published patch diff. CWE-835 (infinite loop) is a DoS-only class - there is no code execution, memory corruption, or data exfiltration potential. Real-world risk is strongly deployment-context dependent: internet-facing services that accept untrusted PDF uploads and perform merge operations (document converters, form processors, report generators) face meaningful DoS exposure, while internal CLI tooling has low practical risk. The attack primitive - crafting a PDF with a cyclic outline structure - is low-complexity and replicable from the patch context alone, so treating the absence of a known POC as a strong mitigating factor would be an error. Priority should be moderate-to-high for any externally reachable pypdf merge deployment; low for isolated internal usage.

Exploit ScenarioDerived

An attacker uploads a crafted PDF file in which the /Outlines dictionary contains a node whose /Next entry points back to an ancestor, forming a cycle invisible to naive parsers. When a vulnerable pypdf application calls PdfWriter.merge() with this file, _get_filtered_outline() enters an infinite loop, consuming CPU until the worker process hangs or is killed by an OS-level resource limit. If the application does not enforce an operation timeout, repeated submissions can exhaust all worker threads or processes, resulting in a complete denial of service for all users.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 16, 2026

Processing crafted PDF outlines in pypdf versions prior to 6.13.0 triggers an infinite loop during writer merge operations, causing a denial of service. Applications that accept user-supplied PDFs and merge them using PdfWriter are affected - specifically any code path that calls merge() on a PDF whose /Outlines or /Parent hierarchy contains circular references. No public exploit has been identified at time of analysis and this is not listed in CISA KEV; a vendor-released patch is available as pypdf 6.13.0.

RemediationAI

Upgrade pypdf to version 6.13.0 or later using pip install 'pypdf>=6.13.0'; the release is confirmed at https://github.com/py-pdf/pypdf/releases/tag/6.13.0. If an immediate upgrade is not possible, the upstream fix from PR #3830 (https://github.com/py-pdf/pypdf/pull/3830) can be manually applied to the local installation - it adds a visited set of object IDs to _get_filtered_outline() in _writer.py and to _layout_mode_fonts() in _page.py to break cycles. As a compensating control, wrap merge operations in a subprocess or thread with a strict wall-clock timeout (e.g., concurrent.futures.ThreadPoolExecutor with a timeout, or subprocess with a timeout parameter) to bound the impact of an infinite loop; note this adds latency overhead and requires error handling for timeout exceptions. Additionally, restricting PDF merge endpoints to authenticated or trusted users reduces the attack surface when patching is delayed.

Affected VersionsENISA

pypdf < 6.13.0

Affected Packages

pypi pypdf fix: 6.13.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

pypdf is a pure-Python PDF processing library (pip package: pkg:pip/pypdf) used to read, write, split, and merge PDF documents. The vulnerability class is CWE-835 (Loop with Unreachable Exit Condition). The PDF specification allows outline/bookmark nodes to be linked via /First, /Next, and /Last dictionary entries, and page objects to reference ancestors via /Parent entries. Prior to the fix, two traversal functions - _get_filtered_outline() in pypdf/_writer.py and _layout_mode_fonts() in pypdf/_page.py - iterated these linked structures without any cycle detection. A crafted PDF can embed circular references (e.g., an outline node whose /Next points back to an ancestor), causing the while loop to run indefinitely. The patch in PR #3830 introduces a visited set of object IDs in both traversal routines and breaks with a logged warning upon detecting a cycle, consistent with standard cycle-detection techniques for graph traversal.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/py-pdf/pypdf) PRIMARY 6.9 MEDIUM
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
vuln.today AI 7.5 HIGH

Worst-case assumes network-reachable merge endpoint with no authentication; only availability is impacted via infinite loop with no code execution possible.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE MEDIUM
Red Hat 5.5 MEDIUM

Primary rating from Vendor (https://github.com/py-pdf/pypdf).

CVSS VectorVendor: https://github.com/py-pdf/pypdf

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
CVSS changed
Jun 22, 2026 - 21:39 NVD
6.9 (MEDIUM)

DescriptionCVE.org

Impact

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.

Patches

This has been fixed in pypdf==6.13.0.

Workarounds

If you cannot upgrade yet, consider applying the changes from PR #3830.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 1 pypi packages depend on pypdf (1 direct, 0 indirect)

Ecosystem-wide dependent count for version 6.13.0.

Threat Intelligence Overview

EPSS Score
0.1%
Top 97% exploitable
Threat Intel
1
1 source
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Small
Automatable
Yes
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Vendor StatusVendor

SUSE

Severity: Moderate

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy