# CVE-2022-24859: pypdf2: PyPDF2 is an open source python PDF library capable of splitting, merging, cropping, and transforming the pages of PD...

CVE-2022-24859 is fixed in 4 products on 1 platform, first by python-pypdf2 1.26.0-2ubuntu0.1~esm1, released April 18, 2022. It is not reported as exploited. Patch Radar priority: Routine.

- Web page: https://patchblox.com/security/cve/CVE-2022-24859
- Priority: Routine
- CVSS: 5.5 (medium)
- EPSS: 0.0133
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Apr 18, 2022

## 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.

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | pypdf2 Debian 12.15 (bookworm) | 1.27.9-1 | [DEBIAN-CVE-2022-24859](https://patchblox.com/security/data/fix/linux/debian-cve-2022-24859.md) | Apr 18, 2022 |
| Linux | python-PyPDF2 opensuse-leap 15.6 | 1.26.0-bp156.4.3.1 | [OPENSUSE-SU-2024:0366-1](https://patchblox.com/security/data/fix/linux/opensuse-su-2024-0366-1.md) | Nov 12, 2024 |
| Linux | python-pypdf2 Ubuntu 18.04.6 LTS (bionic) | 1.26.0-2ubuntu0.1~esm1 | [python-pypdf2 1.26.0-2ubuntu0.1~esm1](https://patchblox.com/security/data/fix/linux/ubuntu-bionic-python-pypdf2-1.26.0-2ubuntu0.1-esm1.md) | Apr 18, 2022 |
| Linux | python-pypdf2 Ubuntu 20.04 LTS (focal) | 1.26.0-3ubuntu1.20.04.1 | [python-pypdf2 1.26.0-3ubuntu1.20.04.1](https://patchblox.com/security/data/fix/linux/ubuntu-focal-python-pypdf2-1.26.0-3ubuntu1.20.04.1.md) | Apr 18, 2022 |
| Linux | python3-pypdf2 Ubuntu 18.04.6 LTS (bionic) | 1.26.0-2ubuntu0.1~esm1 | [python3-pypdf2 1.26.0-2ubuntu0.1~esm1](https://patchblox.com/security/data/fix/linux/ubuntu-bionic-python3-pypdf2-1.26.0-2ubuntu0.1-esm1.md) | Apr 18, 2022 |
| Linux | python3-pypdf2 Ubuntu 20.04 LTS (focal) | 1.26.0-3ubuntu1.20.04.1 | [python3-pypdf2 1.26.0-3ubuntu1.20.04.1](https://patchblox.com/security/data/fix/linux/ubuntu-focal-python3-pypdf2-1.26.0-3ubuntu1.20.04.1.md) | Apr 18, 2022 |
| Linux | python3-pypdf2 Ubuntu 22.04.1 LTS (jammy) | 1.26.0-4ubuntu0.22.04.1 | [python3-pypdf2 1.26.0-4ubuntu0.22.04.1](https://patchblox.com/security/data/fix/linux/ubuntu-jammy-python3-pypdf2-1.26.0-4ubuntu0.22.04.1.md) | Apr 18, 2022 |

---

Data as of 2026-11-08T13:06:02Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
