---
id: CVE-2026-54651
aliases:
  - GHSA-g9xf-7f8q-9mcj
title: 'pypdf: Possible infinite loop when processing threads/articles in writer'
summary: 'pypdf: Possible infinite loop when processing threads/articles in writer'
severity: medium
cwe:
  - CWE-835
vendor: pypdf
product: pypdf
ecosystem: pip
affected:
  - pypdf < 6.13.1
patched:
  - pypdf 6.13.1
published: '2026-07-09'
updated: '2026-07-09'
source: GHSA
sourceUrl: 'https://github.com/advisories/GHSA-g9xf-7f8q-9mcj'
references:
  - url: 'https://github.com/py-pdf/pypdf/security/advisories/GHSA-g9xf-7f8q-9mcj'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-54651'
  - url: 'https://github.com/py-pdf/pypdf/pull/3839'
  - url: 'https://github.com/py-pdf/pypdf/releases/tag/6.13.1'
  - url: 'https://github.com/advisories/GHSA-g9xf-7f8q-9mcj'
tags:
  - ghsa
  - pip
epss: 0.00158
epssPercentile: 0.04229
ingestedAt: '2026-07-09T21:52:34.633Z'
---

## Overview

### Impact

An attacker who uses this vulnerability can craft a PDF which leads to an infinite loop. This requires merging a file with threads/articles into a writer.

### Patches

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

### Workarounds

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

## Affected packages

- `pypdf < 6.13.1`

## Remediation

Upgrade to a patched release:

- `pypdf 6.13.1`
