CVE-2022-24859Pypdf2 Project Pypdf2
Medium 5.5
Follow: this CVE · Pypdf2 Project · Pypdf2 Project Pypdf2 We alert you by email or Slack (account required).
- Priority
- 33
- CVSS 3.1
- 5.5
- EPSS
- 1.3% probability of exploitation in 30 days · percentile 71
- Auth required
- Yes
- Published
- Apr 18, 2022
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-835
- SSVC (CISA)
- Exploitation: proof of concept · Automatable: no · Technical impact: partial
- Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
What happens
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.
What to do
- Apply the vendor's security update for Pypdf2.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| PyPI | pypdf2 |
< 1.27.5 |
1.27.5 |
pip install "pypdf2>=1.27.5" |
| PyPI | pypdf2 |
< 1.27.5 |
1.27.5 |
pip install "pypdf2>=1.27.5" |
Per OSV / GitHub Advisories (GHSA-xcjx-m2pj-8g79, PYSEC-2022-194). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| pypdf2_project | pypdf2 | < 1.27.5 |
| debian | debian_linux | 9.0 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Exploit Third Party Advisory
- github.com Patch Third Party Advisory
- github.com Release Notes Third Party Advisory
- github.com Exploit Third Party Advisory
- lists.debian.org Mailing List Third Party Advisory
- lists.debian.org