Read the docs
TI-2022-08670 Aliases CVE-2022-24859GHSA-xcjx-m2pj-8g79

Manipulated inline images can cause Infinite Loop in PyPDF2

Priority MEDIUM 61CWE-835Published · Updated

Key facts

Attack vector
Local
Privileges required
None
User interaction
None
Attack complexity
Low
Impact type
Denial of service
Confidentiality · integrity · availability
None · None · High
Fix status
Partial Red Hat: 1 without a fix

Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-835.

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.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.01328 71st percentileScored 2026-11-07
Public exploit Yes 2 exploit referencesTagged by NVD
Fix Partial PyPDF2 (py-pdf): 1.27.5PyPDF2 (PyPI): 1.27.5Red Hat: 1 without a fix

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
No
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
py-pdfPyPDF2before 1.27.51.27.5Patch availableCNA
—PyPDF2 (PyPI)before 1.27.51.27.5Patch availableGHSA-xcjx-m2pj-8g79
  • PyPDF2 Vendorpy-pdf Affected before 1.27.5 Fixed in 1.27.5 Patch available CNA
  • PyPDF2 (PyPI) Vendor— Affected before 1.27.5 Fixed in 1.27.5 Patch available GHSA-xcjx-m2pj-8g79

CPE configurations NVD · 2

CPEVersionsRoleVendor
cpe:2.3:a:pypdf2_project:pypdf2:*:*:*:*:*:*:*:*before 1.27.5VulnerablePypdf2 Project
cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*9.0VulnerableDebian
  • cpe:2.3:a:pypdf2_project:pypdf2:*:*:*:*:*:*:*:* Versions before 1.27.5 Vulnerable ·Pypdf2 Project
  • cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* Versions 9.0 Vulnerable ·Debian

Remediation

  • Fix · CNA PyPDF2 (py-pdf) Fixed in 1.27.5
  • Fix · GHSA-xcjx-m2pj-8g79 PyPDF2 (PyPI) Fixed in 1.27.5 Advisory →

Vendor assessments

Red Hat

Red Hat rating: Low. Red Hat's page for this CVE →

ProductStatusPlan or fix
Red Hat Quay 3AffectedNo fix yet

Timeline

  1. 2026-10-02 Threatist record created from CVE-2022-24859
  2. 2026-10-03 Alias added: GHSA-xcjx-m2pj-8g79

References

  • TI-2026-79334 Exponential SVG use expansion exhausts CPU and memory in fpdf2 CVSS 3.1MEDIUM 6.5
  • TI-2023-18601 Infinite Loop when reading malformed objects in pypdf CVSS 3.1MEDIUM 6.5
  • TI-2023-18305 Infinite Loop when a comment isn't followed by a character in pypdf CVSS 3.1MEDIUM 6.2
  • TI-2026-42743 pypdf: Possible infinite loop for not terminated inline images CVSS 4.0HIGH 8.7
  • TI-2026-42742 pypdf: Possible infinite loop for not terminated inline images (ASCII85 and ASCIIHex filter) CVSS 4.0HIGH 8.7
  • TI-2026-65557 pypdf: Possible large memory usage when retrieving alphabetical page labels CVSS 4.0HIGH 8.7
See all 73 →

Sources