CVE-2023-36807 Infinite Loop when reading malformed objects in pypdf
An attacker can cause a denial of service via infinite loop by crafting a malformed PDF processed by the pypdf library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2023-36807?
CVE-2023-36807 is a medium-severity denial of service vulnerability in Pypdf Project Pypdf, published on 30 Jun 2023. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
pypdf is a pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files. In version 2.10.5 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 if the user extracted metadata from such a malformed PDF. Versions prior to 2.10.5 throw an error, but do not hang forever. This issue was fixed with https://github.com/py-pdf/pypdf/pull/1331 which has been included in release 2.10.6. Users are advised to upgrade. Users unable to upgrade should modify `PyPDF2/generic/_data_structures.py::read_object` to an an error throwing case. See GHSA-hm9v-vj3r-r55m for details.
Weakness: CWE-835
Which versions are affected by CVE-2023-36807?
3 open source packages ship an affected version, including pypdf2 and PyPDF2. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
pypdf2 PyPI | From 2.10.5 | 2.10.6 |
pypdf2 PyPI | From 2.10.5 | 2.10.6 |
PyPDF2 PyPI | From 2.10.5 | 2.10.6 |
Products include Pypdf Project Pypdf.
How do I fix CVE-2023-36807?
Upgrade pypdf2 to 2.10.6 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2023-36807 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-36807 exists.
Other vulnerabilities in Pypdf Project Pypdf
- CVE-2026-102993 pypdf: Possible large memory usage when retrieving Roman page labels
- CVE-2026-102994 pypdf: Possible long runtimes/large memory usage when parsing indirect objects
- CVE-2026-102995 pypdf: Possible large memory usage for large /ToUnicode streams (Follow-up 2)
- CVE-2026-102996 pypdf: Possible large memory usage when parsing font data
- CVE-2026-102997 pypdf: Possible long runtimes for partially malformed FlateDecode streams (Follow-up)
Sources
Also known as DEBIAN-CVE-2023-36807, GHSA-hm9v-vj3r-r55m, PYSEC-2026-1836.