---
id: "CVE-2026-113793"
kind: "vulnerability"
aliases: ["CVE-2026-113793", "GHSA-9mx8-4j7g-633p"]
title: "pypdf: Possible infinite loop when removing tree items"
severity: "medium"
cvss: 6.0
epss: 0.004660000093281269
exploited: false
status: "open"
category: "package"
products: [{"name": "pypdf", "fixed": ["6.20.1"], "affected": "< 6.20.1", "ecosystem": "pypi"}]
ecosystems: ["pypi"]
tags: ["cwe-835", "document-processing", "package", "pypdf", "python"]
not_affected_if: ["does-not-remove-tree-items", "no-untrusted-pdfs"]
published_at: "2026-10-21T16:17:27+00:00"
first_seen_at: "2026-10-23T19:11:32+00:00"
updated_at: "2026-10-23T21:57:29+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-9mx8-4j7g-633p", "first_seen_at": "2026-10-23T19:11:32+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113793", "first_seen_at": "2026-10-23T21:57:29+00:00"}]
---

# pypdf: Possible infinite loop when removing tree items

pypdf, a Python PDF library, can enter an infinite loop when it removes an object from a PDF tree such as an outline item in a crafted file. An attacker who supplies such a PDF can hang the process that parses it, causing a denial of service.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:pypdf affected < 6.20.1 fixed 6.20.1

## How to check

Run pip show pypdf and check whether the version is below 6.20.1.
Search requirements or lock files for pypdf to find pinned versions.

## Fix

Upgrade pypdf to 6.20.1 or later.
If you cannot upgrade yet, apply the changes from PR #4188 in the pypdf repository as the advisory suggests.

## Timeline

- 2026-10-23T19:11:32+00:00 ghsa https://github.com/advisories/GHSA-9mx8-4j7g-633p
- 2026-10-23T21:57:29+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-113793

## From the sources

### Impact

An attacker who uses this vulnerability can craft a PDF which leads to an infinite loop. This requires removing an object from a tree, for example an outline item.

### Patches

This has been fixed in [pypdf==6.20.1](https://github.com/py-pdf/pypdf/releases/tag/6.20.1).

### Workarounds

If you cannot upgrade yet, consider applying the changes from PR [#4188](https://github.com/py-pdf/pypdf/pull/4188).

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
