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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | pypdf | 3.4.1-1+deb12u1 | DEBIAN-CVE-2023-36464 |
| Debian:13 | pypdf | 3.17.4-1 | DEBIAN-CVE-2023-36464 |
| Debian:14 | pypdf | 3.17.4-1 | DEBIAN-CVE-2023-36464 |
| Debian:12 | pypdf2 | 2.12.1-3+deb12u1 | DEBIAN-CVE-2023-36464 |
| PyPI | pypdf | 3.9.0 | GHSA-4vvm-4w3v-6mr8 |
| PyPI | pypdf | 3.9.0 | PYSEC-2026-3008 |
| PyPI | pypdf2 | 3.9.0 | PYSEC-2026-1835 |
| PyPI | pypdf2 | no fix listed | GHSA-4vvm-4w3v-6mr8 |
| Ubuntu:24.04:LTS | pypdf | no fix listed | UBUNTU-CVE-2023-36464 |
| Ubuntu:25.10 | pypdf | no fix listed | UBUNTU-CVE-2023-36464 |
| Ubuntu:26.04:LTS | pypdf | no fix listed | UBUNTU-CVE-2023-36464 |
| Ubuntu:26.10 | pypdf | no fix listed | UBUNTU-CVE-2023-36464 |
Affected products (as reported)
Weakness: CWE-835 · Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
References
- https://github.com/py-pdf/pypdf/security/advisories/GHSA-4vvm-4w3v-6mr8 x_refsource_CONFIRM
- https://github.com/py-pdf/pypdf/pull/1828 x_refsource_MISC
- https://github.com/py-pdf/pypdf/pull/969 x_refsource_MISC