CVE-2023-36807 Infinite Loop when reading malformed objects in pypdf
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- Proof of concept public · automatable: no · technical impact: partial
- Technology
- UbuntuDebian
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.
Upgrade path
10 packages: 8 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| debian/pypdf2(Debian 12) | < 2.10.7-1 | 2.10.7-1 | Fixed |
| pypi pypdf2(PyPI) | = 2.10.5; >= 2.10.5, < 2.10.6 | 2.10.6 | Fixed |
| ubuntu/pypdf2(Ubuntu 16.04) | < 1.25.1-1; = 1.23+git20141008-1 | 1.25.1-1 | Fixed |
| ubuntu/pypdf2(Ubuntu 18.04) | < 1.26.0-2 | 1.26.0-2 | Fixed |
| ubuntu/pypdf2(Ubuntu 20.04) | < 1.26.0-3ubuntu1.20.04.1; = 1.26.0-2; = 1.26.0-3ubuntu1 | 1.26.0-3ubuntu1.20.04.1 | Fixed |
| ubuntu/pypdf2(Ubuntu 22.04) | < 1.26.0-4ubuntu0.22.04.1; = 1.26.0-4 | 1.26.0-4ubuntu0.22.04.1 | Fixed |
| ubuntu/pypdf2(Ubuntu Pro 16.04) | < 1.25.1-1ubuntu0.1~esm2; = 1.23+git20141008-1; = 1.25.1-1; = 1.25.1-1ubuntu0.1~esm1 | 1.25.1-1ubuntu0.1~esm2 | Fixed |
| ubuntu/pypdf2(Ubuntu Pro 18.04) | < 1.26.0-2ubuntu0.1~esm2; = 1.26.0-2; = 1.26.0-2ubuntu0.1~esm1 | 1.26.0-2ubuntu0.1~esm2 | Fixed |
| py-pdf pypdf | = 2.10.5 | No fix listed | Versions listed |
| pypdf project pypdf | = 2.10.5 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| pypi pypdf2(PyPI) | >= 2.10.5, < 2.10.6 | 2.10.6 |
| pypi pypdf2(PyPI) | = 2.10.5 | No fix listed |
| debian/pypdf2(Debian:12) | < 2.10.7-1 | 2.10.7-1 |
| py-pdf pypdf | = 2.10.5 | No fix listed |
| pypdf project pypdf | = 2.10.5 | No fix listed |
| ubuntu/pypdf2(Ubuntu:16.04) | < 1.25.1-1 | 1.25.1-1 |
| ubuntu/pypdf2(Ubuntu:16.04) | = 1.23+git20141008-1 | No fix listed |
| ubuntu/pypdf2(Ubuntu:Pro:16.04) | < 1.25.1-1ubuntu0.1~esm2 | 1.25.1-1ubuntu0.1~esm2 |
| ubuntu/pypdf2(Ubuntu:Pro:16.04) | = 1.23+git20141008-1 | No fix listed |
| ubuntu/pypdf2(Ubuntu:Pro:16.04) | = 1.25.1-1 | No fix listed |
| ubuntu/pypdf2(Ubuntu:Pro:16.04) | = 1.25.1-1ubuntu0.1~esm1 | No fix listed |
| ubuntu/pypdf2(Ubuntu:18.04) | < 1.26.0-2 | 1.26.0-2 |
| ubuntu/pypdf2(Ubuntu:Pro:18.04) | < 1.26.0-2ubuntu0.1~esm2 | 1.26.0-2ubuntu0.1~esm2 |
| ubuntu/pypdf2(Ubuntu:Pro:18.04) | = 1.26.0-2 | No fix listed |
| ubuntu/pypdf2(Ubuntu:Pro:18.04) | = 1.26.0-2ubuntu0.1~esm1 | No fix listed |
| ubuntu/pypdf2(Ubuntu:20.04) | < 1.26.0-3ubuntu1.20.04.1 | 1.26.0-3ubuntu1.20.04.1 |
| ubuntu/pypdf2(Ubuntu:20.04) | = 1.26.0-2 | No fix listed |
| ubuntu/pypdf2(Ubuntu:20.04) | = 1.26.0-3ubuntu1 | No fix listed |
| ubuntu/pypdf2(Ubuntu:22.04) | < 1.26.0-4ubuntu0.22.04.1 | 1.26.0-4ubuntu0.22.04.1 |
| ubuntu/pypdf2(Ubuntu:22.04) | = 1.26.0-4 | No fix listed |
References
- https://github.com/py-pdf/pypdf/security/advisories/GHSA-hm9v-vj3r-r55m exploit issue-tracking mitigation patch vendor-advisory
- nvd.nist.gov third-party-advisory vendor-advisory
- https://github.com/py-pdf/pypdf/issues/1329 exploit issue-tracking vendor-advisory
- https://github.com/py-pdf/pypdf/pull/1331 issue-tracking patch
- github.com patch
- github.com product
- github.com vendor-advisory
- pypi.org product
- Debian Security Tracker CVE-2023-36807 vendor-advisory
- ubuntu.com issue-tracking
- www.cve.org issue-tracking