Loop with Unreachable Exit Condition ('Infinite Loop') Affecting pypdf package, versions [3.7.0,3.17.0)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.05% (22nd 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-6041514
  • published1 Nov 2023
  • disclosed31 Oct 2023
  • creditAlexander Huszagh

Introduced: 31 Oct 2023

CVE-2023-46250  (opens in a new tab)
CWE-835  (opens in a new tab)

How to fix?

Upgrade pypdf to version 3.17.0 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 Loop with Unreachable Exit Condition ('Infinite Loop') when the PdfWriter(clone_from) function is used with a PDF. An attacker can craft a PDF that leads to an infinite loop. This infinite loop blocks the current process and can utilize a single core of the CPU by 100%. It does not affect memory usage. This is particularly problematic when the user manipulates an incoming malicious PDF, for example, by merging it with another PDF or by adding annotations.

Workaround

This vulnerability can be mitigated by modifying pypdf/generic/_data_structures.py in the same way as in pull request #2264.

CVSS Base Scores

version 3.1