CVE-2023-46250
JSON

5.1medium

pypdf possible Infinite Loop when PdfWriter(clone_from) is used with a PDF

Severity
5.1medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.26% (higher than 18% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-wjcc-cq79-p63fPYSEC-2026-1834

Description

pypdf is a free and open-source pure-python PDF library. An attacker who uses a vulnerability present in versions 3.7.0 through 3.16.4 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. The issue was fixed in version 3.17.0. As a workaround, apply the patch manually by modifying `pypdf/generic/_data_structures.py`.

Affected

Product or packageVersionsReported by
py-pdf pypdf>= 3.7.0, < 3.17.0, from 3.7.0 before 3.17.0CVE List, NVD
pypdf (PyPI)from 3.7.0 before 3.17.0GitHub Advisory Database, PyPA Advisory Database

All scores

GitHub_M5.1medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub5.1medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD5.5medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
PyPA Advisory Database5.1medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-835

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

pypdf is a free and open-source pure-python PDF library. An attacker who uses a vulnerability present in versions 3.7.0 through 3.16.4 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. The issue was fixed in version 3.17.0. As a workaround, apply the patch manually by modifying `pypdf/generic/_data_structures.py`.

GitHub Advisory Database
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.

NVD (es)

pypdf es una librería de PDF pura de Python gratuita y de código abierto. Un atacante que utilice una vulnerabilidad presente en las versiones 3.7.0 a 3.16.4 puede crear un PDF que genere un bucle infinito. Este bucle infinito bloquea el proceso actual y puede utilizar un solo núcleo de la CPU al 100%. No afecta el uso de la memoria. Ese es, por ejemplo, el caso cuando el usuario de pypdf manipula un PDF malicioso entrante, por ejemplo fusionándolo con otro PDF o agregando anotaciones. El problema se solucionó en la versión 3.17.0. Como workaround, aplique el parche manualmente modificando `pypdf/generic/_data_structures.py`.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-46250 changed 2024-09-05CVE Terms of Use
GitHub Advisory DatabaseGHSA-wjcc-cq79-p63f changed 2026-09-10CC-BY-4.0
NVDCVE-2023-46250 changed 2026-11-02Public domain
PyPA Advisory DatabasePYSEC-2026-1834 changed 2026-07-07CC-BY-4.0