Vulnerability · Published Jun 27, 2023 · Assigned by GitHub_M

CVE-2023-36464Infinite Loop when a comment isn't followed by a character in pypdf

Medium 6.2

In plain English

A medium-severity infinite loop in pypdf from py-pdf. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 29% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)6.2Medium
Exploit odds (30 days)0.4%top 70.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official description

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"")`.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12pypdf3.4.1-1+deb12u1DEBIAN-CVE-2023-36464
Debian:13pypdf3.17.4-1DEBIAN-CVE-2023-36464
Debian:14pypdf3.17.4-1DEBIAN-CVE-2023-36464
Debian:12pypdf22.12.1-3+deb12u1DEBIAN-CVE-2023-36464
PyPIpypdf3.9.0GHSA-4vvm-4w3v-6mr8
PyPIpypdf3.9.0PYSEC-2026-3008
PyPIpypdf23.9.0PYSEC-2026-1835
PyPIpypdf2no fix listedGHSA-4vvm-4w3v-6mr8
Ubuntu:24.04:LTSpypdfno fix listedUBUNTU-CVE-2023-36464
Ubuntu:25.10pypdfno fix listedUBUNTU-CVE-2023-36464
Ubuntu:26.04:LTSpypdfno fix listedUBUNTU-CVE-2023-36464
Ubuntu:26.10pypdfno fix listedUBUNTU-CVE-2023-36464

Affected products (as reported)

VendorProductVersions
py-pdf pypdf pypdf: < 3.90PyPDF2: >= 2.2.0

Weakness: CWE-835 · Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References