---
id: CVE-2023-46250
aliases:
  - GHSA-wjcc-cq79-p63f
  - PYSEC-2026-1834
title: Possible Infinite Loop when PdfWriter(clone_from) is used with a PDF
summary: Possible Infinite Loop when PdfWriter(clone_from) is used with a PDF
severity: medium
cvss: 5.1
cvssVector: 'CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H'
vendor: pypdf
product: pypdf
ecosystem: pip
affected:
  - 'pypdf >= 3.7.0, < 3.17.0'
patched:
  - pypdf 3.17.0
published: '2023-10-31'
updated: '2026-09-10'
sourceUpdated: '2026-09-10T03:50:08.746181393Z'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-wjcc-cq79-p63f'
references:
  - url: 'https://github.com/py-pdf/pypdf/security/advisories/GHSA-wjcc-cq79-p63f'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2023-46250'
  - url: 'https://github.com/py-pdf/pypdf/pull/2264'
  - url: >-
      https://github.com/py-pdf/pypdf/commit/9b23ac3c9619492570011d551d521690de9a3e2d
  - url: 'https://github.com/py-pdf/pypdf'
tags:
  - osv
  - pip
epss: 0.00243
epssPercentile: 0.13839
ingestedAt: '2026-07-08T18:25:53.824Z'
---

## Overview

### Impact
An attacker who uses this vulnerability can craft a PDF which 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.

That is, for example, the case when the pypdf-user manipulates an incoming malicious PDF e.g. by merging it with another PDF or by adding annotations.

### Patches
The issue was fixed with #2264

### Workarounds
If you cannot update your version of pypdf, you should modify `pypdf/generic/_data_structures.py` just like #2264 did.

## Affected packages

- `pypdf >= 3.7.0, < 3.17.0`

## Remediation

Upgrade to a patched release:

- `pypdf 3.17.0`
