Infinite loop Affecting pypdf package, versions [3.1.0,6.13.1)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.11% (2nd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-PYPDF-17420043
  • published23 Jun 2026
  • disclosed22 Jun 2026
  • creditk0w4lzk1

Introduced: 22 Jun 2026

NewCVE-2026-54651  (opens in a new tab)
CWE-835  (opens in a new tab)

How to fix?

Upgrade pypdf to version 6.13.1 or higher.

Overview

pypdf is an A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files

Affected versions of this package are vulnerable to Infinite loop through the _add_articles_thread method in PdfWriter when processing PDF thread/article structures. An attacker can trigger an infinite loop by supplying a PDF with a cyclic /F//N article chain that is cloned while writing or filtering threads. This can hang the application and prevent users from completing PDF processing, consuming CPU until the request or process is terminated.

Workarounds

  • If you cannot upgrade yet, apply the changes from PR #3839 to your local pypdf checkout so PdfWriter no longer loops indefinitely when merging files that contain threads/articles.

CVSS Base Scores

version 4.0
version 3.1