# CVE-2026-113793: pypdf infinite loop in cyclic PDF tree removal

Source: https://junglewise.ai/threats/cve-2026-113793-pypdf-is-a-free-and-open-source-pure-python-pdf-library-prior-to  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-21. Updated: 2026-10-21  
License: CC BY 4.0 with a link back

CVE-2026-113793 · Severity: medium · CVSS 4 · Published 2026-10-21

pypdf is a Python library for reading and writing PDF files. When processing a specially crafted PDF with cyclic references in its outline tree, removing an object can cause the application to enter an infinite loop, resulting in a process hang or denial of service.

Technologies: [Py-Pdf Pypdf](https://junglewise.ai/threats/technologies/py-pdf-pypdf), [pypdf (PyPI)](https://junglewise.ai/threats/technologies/pypdf). Vendors: [Py-Pdf](https://junglewise.ai/threats/vendors/py-pdf), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-113793 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-113793 being exploited in the wild.

**How severe is CVE-2026-113793?** Medium severity, with a CVSS score of 4, published 21 October 2026.

**Which products and versions are affected?** Py-Pdf Pypdf before 6.20.1; pypdf (PyPI) < 6.20.1, ECOSYSTEM:introduced=0,fixed=6.20.1.

**Is there a fix for CVE-2026-113793?** Yes. pypdf (PyPI): upgrade to 6.20.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-113793 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-113793?** Check whether you run Py-Pdf Pypdf or pypdf (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- pypdf (PyPI): upgrade to 6.20.1 or later

  ```sh
  pip install "pypdf>=6.20.1"
  ```


## Technical details

The vulnerability exists in the TreeObject.remove_child method and PdfWriter.find_outline_item method, which do not properly handle cyclic references in PDF tree structures. An attacker can craft a PDF with circular pointers in the outline tree; when the vulnerable code attempts to remove or traverse such an object, it enters an infinite loop. A fix is available in version 6.20.1.

## Affected products

- py-pdf pypdf before 6.20.1

## Identifiers

- CVE-2026-113793
- GHSA-9mx8-4j7g-633p

## Timeline

- 2026-10-21: disclosed
- 2026-10-12: patched

## References

- [https://github.com/py-pdf/pypdf/commit/c9c35b4471c2eb5fe078094f6c816e69d4ed25a0](https://github.com/py-pdf/pypdf/commit/c9c35b4471c2eb5fe078094f6c816e69d4ed25a0)
- [https://github.com/py-pdf/pypdf/pull/4188](https://github.com/py-pdf/pypdf/pull/4188)

## Related threats

- [pypdf memory exhaustion in cross-reference stream parsing](https://junglewise.ai/threats/cve-2026-119209-pypdf-is-a-free-and-open-source-pure-python-pdf-library-prior-to)
- [pypdf denial of service via forged encrypted PDF page count](https://junglewise.ai/threats/cve-2026-119208-pypdf-is-a-free-and-open-source-pure-python-pdf-library-prior-to)
- [pypdf excessive memory consumption in strict mode PDF parsing](https://junglewise.ai/threats/cve-2026-119207-pypdf-is-a-free-and-open-source-pure-python-pdf-library-prior-to)
- [pypdf denial of service via crafted page labels](https://junglewise.ai/threats/cve-2026-119206-pypdf-is-a-free-and-open-source-pure-python-pdf-library-prior-to)
- [pypdf infinite loop in DictionaryObject cloning](https://junglewise.ai/threats/cve-2026-119205-pypdf-is-a-free-and-open-source-pure-python-pdf-library-prior-to)
