VDB

CVE-2022-24859

CVE-2022-24859 PUBLISHED CVSS 6.2 MEDIUM

Manipulated inline images can cause Infinite Loop in PyPDF2

Reported by github_m · Published April 18, 2022

PyPDF2 is fixed in 1.27.5 (PyPI)

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.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
PyPDF2PyPI1.27.5
pypdf2pypdf2_project1.27.5

Risk scores

CVSS 3.1
6.2
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected products

VendorProductVersions
py-pdfPyPDF2< 1.27.5
PyPIPyPDF20
py-pdfPyPDF20

Timeline

  • Apr 18, 2022 CVE Published
  • Apr 19, 2022 EPSS Score (30 in total, the first dated here)
  • Mar 9, 2026 Security Advisory (2 in total, the first dated here)
  • Jun 17, 2026 CVE Updated
  • Jul 2, 2026 Coalition ESS Score

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2022-24859
vulnetix vdb fixes CVE-2022-24859

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2022-24859/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›