CVE-2022-24859 Manipulated inline images can cause Infinite Loop in PyPDF2
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- Proof of concept public · automatable: no · technical impact: partial
- Technology
- UbuntuDebian
Description
PyPDF2 is an open source python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files. In versions prior to 1.27.5 an attacker who uses this vulnerability can craft a PDF which leads to an infinite loop if the PyPDF2 if the code attempts to get the content stream. The reason is that the last while-loop in ContentStream._readInlineImage only terminates when it finds the EI token, but never actually checks if the stream has already ended. This issue has been resolved in version 1.27.5. Users unable to upgrade should validate and PDFs prior to iterating over their content stream.
Upgrade path
9 packages: 7 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| debian/pypdf2(Debian 12) | < 1.27.9-1 | 1.27.9-1 | Fixed |
| pypdf2 project pypdf2 | < 1.27.5 | 1.27.5 | Fixed |
| pypi pypdf2(PyPI) | < 1.27.5; = 1.15; = 1.16; = 1.17 +15 more | 1.27.5 | 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~esm1; = 1.23+git20141008-1; = 1.25.1-1 | 1.25.1-1ubuntu0.1~esm1 | Fixed |
| ubuntu/pypdf2(Ubuntu Pro 18.04) | < 1.26.0-2ubuntu0.1~esm1; = 1.26.0-2 | 1.26.0-2ubuntu0.1~esm1 | Fixed |
| debian linux | = 9.0 | No fix listed | Versions listed |
| py-pdf PyPDF2 | = < 1.27.5 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| pypi pypdf2(PyPI) | < 1.27.5 | 1.27.5 |
| pypi pypdf2(PyPI) | = 1.15 | No fix listed |
| pypi pypdf2(PyPI) | = 1.16 | No fix listed |
| pypi pypdf2(PyPI) | = 1.17 | No fix listed |
| pypi pypdf2(PyPI) | = 1.18 | No fix listed |
| pypi pypdf2(PyPI) | = 1.19 | No fix listed |
| pypi pypdf2(PyPI) | = 1.20 | No fix listed |
| pypi pypdf2(PyPI) | = 1.21 | No fix listed |
| pypi pypdf2(PyPI) | = 1.22 | No fix listed |
| pypi pypdf2(PyPI) | = 1.23 | No fix listed |
| pypi pypdf2(PyPI) | = 1.24 | No fix listed |
| pypi pypdf2(PyPI) | = 1.25 | No fix listed |
| pypi pypdf2(PyPI) | = 1.25.1 | No fix listed |
| pypi pypdf2(PyPI) | = 1.26.0 | No fix listed |
| pypi pypdf2(PyPI) | = 1.27.0 | No fix listed |
| pypi pypdf2(PyPI) | = 1.27.1 | No fix listed |
| pypi pypdf2(PyPI) | = 1.27.2 | No fix listed |
| pypi pypdf2(PyPI) | = 1.27.3 | No fix listed |
| pypi pypdf2(PyPI) | = 1.27.4 | No fix listed |
| py-pdf PyPDF2 | = < 1.27.5 | No fix listed |
| ubuntu/pypdf2(Ubuntu:22.04) | < 1.26.0-4ubuntu0.22.04.1 | 1.26.0-4ubuntu0.22.04.1 |
| pypdf2 project pypdf2 | < 1.27.5 | 1.27.5 |
| debian linux | = 9.0 | No fix listed |
| debian/pypdf2(Debian:12) | < 1.27.9-1 | 1.27.9-1 |
| ubuntu/pypdf2(Ubuntu:Pro:16.04) | < 1.25.1-1ubuntu0.1~esm1 | 1.25.1-1ubuntu0.1~esm1 |
Show 8 more
| Product | Affected versions | Fixed in |
|---|---|---|
| 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:18.04) | < 1.26.0-2ubuntu0.1~esm1 | 1.26.0-2ubuntu0.1~esm1 |
| ubuntu/pypdf2(Ubuntu:Pro:18.04) | = 1.26.0-2 | 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-4 | No fix listed |
References
- github.com exploit issue-tracking third-party-advisory vendor-advisory
- nvd.nist.gov third-party-advisory vendor-advisory
- github.com exploit issue-tracking third-party-advisory
- github.com issue-tracking patch third-party-advisory
- github.com product
- github.com issue-tracking release-notes third-party-advisory
- github.com
- [debian-lts-announce] 20220603 [SECURITY] [DLA 3039-1] pypdf2 security update mailing-list third-party-advisory
- [debian-lts-announce] 20230609 [SECURITY] [DLA 3451-1] pypdf2 security update mailing-list
- github.com
- Debian Security Tracker CVE-2022-24859 vendor-advisory
- Ubuntu CVE tracker issue-tracking vendor-advisory
- USN-6176-1 vendor-advisory
- www.cve.org issue-tracking
- bugs.debian.org issue-tracking