Advisory

GHSA-xcjx-m2pj-8g79

Also known as: CVE-2022-24859, PYSEC-2022-194

Summary

Manipulated inline images can cause Infinite Loop in PyPDF2

Details

Impact

An attacker who uses this vulnerability can craft a PDF which leads to an infinite loop if the PyPDF2 user wrote the following code:

from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.pdf import ContentStream

reader = PdfFileReader("malicious.pdf", strict=False)
for page in reader.pages:
    ContentStream(page.getContents(), reader)

Patches

`PyPDF2==1.27.5` and later are patched.

Credits to Sebastian Krause for finding (issue) and fixing (PR) it.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2022-04-22 20:54 UTC
Modified
2024-10-14 18:55 UTC

Affected packages and fixes

pypdf2

PyPI · All systems

Affected

  • introduced 0, fixed 1.27.5 (ecosystem)

Fixed versions

1.27.5

Fix

  • Fixed version 1.27.5
    pip install --upgrade pypdf2==1.27.5

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences