Live threats

All CVEs / Pypdf2 Project

CVE-2022-24859Pypdf2 Project Pypdf2

Medium 5.5

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.

Original NVD text.

What to do

  1. Apply the vendor's security update for Pypdf2.

Affected packages

EcosystemPackageAffected versionsFixed inHow 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)

VendorProductVersions
pypdf2_projectpypdf2< 1.27.5
debiandebian_linux9.0

Official sources

References

Links published by the sources. Open them with care.