Skip to main content
← All vulnerabilities
CVE-2022-24859GHSA-XCJX-M2PJ-8G79PYSEC-2022-194

Manipulated inline images can cause Infinite Loop in PyPDF2

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 1.27.5
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: poc
  • Automatable: no
  • Technical impact: partial

Summary

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.

Timeline

  1. CVE published
  2. CISA SSVC assessment

    Exploitation: poc · Automatable: no · Technical impact: partial

  3. Record last updated

Affected versions

  • py-pdf PyPDF2

    fixed in 1.27.5

  • pypdf2PyPI

    fixed in 1.27.5

References 6

GitHub · py-pdf/PyPDF2

lists.debian.org