Skip to main content
← All vulnerabilities
CVE-2023-36464PYSEC-2026-1835GHSA-4VVM-4W3V-6MR8PYSEC-2026-3008

Infinite Loop when a comment isn't followed by a character in pypdf

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

Summary

pypdf is an open source, pure-python PDF library. In affected versions an attacker may craft a PDF which leads to an infinite loop if `__parse_content_stream` is executed. That is, for example, the case if the user extracted text from such a PDF. This issue was introduced in pull request #969 and resolved in pull request #1828. Users are advised to upgrade. Users unable to upgrade may modify the line `while peek not in (b"\r", b"\n")` in `pypdf/generic/_data_structures.py` to `while peek not in (b"\r", b"\n", b"")`.

Timeline

  1. CVE published
  2. CISA SSVC assessment

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

  3. Record last updated

Affected versions

  • py-pdf pypdf

    pypdf: < 3.90, PyPDF2: >= 2.2.0

  • pypdf2PyPI

    From 2.2.0 · fixed in 3.9.0

  • pypdfPyPI

    From 3.1.0 · fixed in 3.9.0

  • pypdf2PyPI

    From 2.2.0 · through 3.0.1

References 3

GitHub · py-pdf/pypdf