CVE-2022-24859

Manipulated inline images can cause Infinite Loop in PyPDF2

MEDIUM
5.5
CVSS Score
Published: April 18, 2022 at 12:00 AM UTC
Updated: June 17, 2026 at 04:32 AM UTC
3 products affected across 3 vendorsDebian LinuxPYPDF2PyPDF2

Using PyPDF2 by py-pdf?

Get instant alerts when new vulnerabilities affect PyPDF2 - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 1%
SSVC
PoC

Description

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 1.27.5
Affected range stops below 1.27.5, so it looks safe — our inference, not a vendor statement
v < 1.27.5
Affected range stops below 1.27.5, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

Patch and advisory references

SSVC — Action Prioritization

SSVCPoCNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
NONE
User Interaction
REQUIRED
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-835

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card