CVE-2023-46250pypdf possible Infinite Loop when PdfWriter(clone_from) is used with a PDF
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`.
What to do
Fixed builds are available from PyPI: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | pypdf | Fix pending | UBUNTU-CVE-2023-46250 | |
| Ubuntu 26.04 | pypdf | Under investigation | UBUNTU-CVE-2023-46250 | |
| Ubuntu 25.10 | pypdf | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2023-46250 | |
| Ubuntu 24.04 | pypdf | Under investigation | UBUNTU-CVE-2023-46250 | |
| Ubuntu 24.04 | pypdf2 | Under investigation | UBUNTU-CVE-2023-46250 | |
| Ubuntu 22.04 | pypdf2 | Under investigation | UBUNTU-CVE-2023-46250 | |
| Ubuntu 20.04 | pypdf2 | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2023-46250 | |
| Ubuntu 18.04 | pypdf2 | Fix pending | UBUNTU-CVE-2023-46250 | |
| Ubuntu 16.04 | pypdf2 | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2023-46250 | |
| PyPI library | pypdf | Fixed | 3.17.0 | GHSA-wjcc-cq79-p63f |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- py-pdf pypdf: affected: >= 3.7.0, < 3.17.0
References
- https://github.com/py-pdf/pypdf/security/advisories/GHSA-wjcc-cq79-p63f
- https://github.com/py-pdf/pypdf/pull/2264
- https://github.com/py-pdf/pypdf/commit/9b23ac3c9619492570011d551d521690de9a3e2d
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.