CVE-2022-24859
Python vulnerability analysis and mitigation

Overview

PyPDF2, a pure Python PDF library, was found to contain a security vulnerability (CVE-2022-24859) that was disclosed on April 18, 2022. The vulnerability affects versions prior to 1.27.5, where an attacker could craft a malicious PDF file containing manipulated inline images that would cause the application to enter an infinite loop when attempting to process the content stream (NVD, GitHub Advisory).

Technical details

The vulnerability exists in the ContentStream._readInlineImage method of PyPDF2. The issue occurs because the last while-loop in this method only terminates when it finds the EI token but never actually checks if the stream has ended. This implementation flaw allows for the creation of a broken inline image that doesn't have an EI token, resulting in an infinite loop. The vulnerability has been assigned a CVSS v3.1 base score of 6.2 (Moderate), with metrics indicating Local attack vector, Low attack complexity, No privileges required, and High availability impact (GitHub Advisory).

Impact

When exploited, this vulnerability can lead to a denial of service condition by consuming system resources through an infinite loop. This affects applications using PyPDF2 to process PDF files, particularly when attempting to read content streams containing inline images (Ubuntu Security).

Exploitability

The vulnerability can be triggered when processing a specially crafted PDF file using PyPDF2's content stream processing functionality. An attacker needs to create a PDF file with manipulated inline images missing the EI token. The exploitation requires no special privileges or user interaction beyond processing the malicious file (GitHub Advisory).

Mitigation and workarounds

The vulnerability was patched in PyPDF2 version 1.27.5, released on April 15, 2022. Users are recommended to upgrade to this version or later to address the security issue. The fix includes improvements to the ContentStream._readInlineImage method to handle cases where the EI token is missing (GitHub Release).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-61539CRITICAL10
  • Python logoPython
  • xinference
NoYesAug 21, 2026
CVE-2026-49360HIGH7.8
  • Python logoPython
  • recce
NoYesAug 21, 2026
CVE-2026-68508HIGH7.8
  • Python logoPython
  • hydra-core
NoYesAug 21, 2026
CVE-2026-54457HIGH7.7
  • Python logoPython
  • tensorzero
NoYesAug 21, 2026
CVE-2026-43980MEDIUM6.3
  • Python logoPython
  • malla
NoNoAug 21, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management