Possible Infinite Loop when PdfWriter(clone_from) is used with a PDF
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 software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | pypdf | >= 3.7.0, < 3.17.0 | 3.17.0 |
References
- https://github.com/py-pdf/pypdf/security/advisories/GHSA-wjcc-cq79-p63f
- https://nvd.nist.gov/vuln/detail/CVE-2023-46250
- https://github.com/py-pdf/pypdf/pull/2264
- https://github.com/py-pdf/pypdf/commit/9b23ac3c9619492570011d551d521690de9a3e2d
- https://github.com/py-pdf/pypdf
- https://pypi.org/project/pypdf
- https://github.com/advisories/GHSA-wjcc-cq79-p63f
- CVSS vector
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H- Weakness (CWE)
CWE-835- Platform
- Python (PyPI)
- Package
pypdf- Disclosed
- 31.10.2023
- Updated
- 11.10.2026 15:17
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2026-1834 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-wjcc-cq79-p63f - CC BY 4.0
Vulnerability history: pypdf
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 51
- First → latest
- 06.2023 10.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 10
- Medium 38
- Low 3
Disclosures per year
- 2023: 2
- 2024: 0
- 2025: 4
- 2026: 45
-
Possible Infinite Loop when PdfWriter(clone_from) is used with a PDF this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.