Infinite Loop when a comment isn't followed by a character in pypdf
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-835.
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"")`.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| py-pdf | pypdf | pypdf: < 3.90; PyPDF2: >= 2.2.0 | — | No fix listed | CNA |
| — | pypdf (PyPI) | 3.1.0 to before 3.9.0 | 3.9.0 | Patch available | GHSA-4vvm-4w3v-6mr8 |
| — | PyPDF2 (PyPI) | 2.2.0 – 3.0.1 | — | No fix listed | GHSA-4vvm-4w3v-6mr8 |
- pypdf Vendorpy-pdf Affected pypdf: < 3.90; PyPDF2: >= 2.2.0 Fixed in — No fix listed CNA
- pypdf (PyPI) Vendor— Affected 3.1.0 to before 3.9.0 Fixed in 3.9.0 Patch available GHSA-4vvm-4w3v-6mr8
- PyPDF2 (PyPI) Vendor— Affected 2.2.0 – 3.0.1 Fixed in — No fix listed GHSA-4vvm-4w3v-6mr8
CPE configurations NVD · 2
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:py-pdf:pypdf:*:*:*:*:*:*:*:* | before 3.9.0 | Vulnerable | py-pdf |
| cpe:2.3:a:pypdf2_project:pypdf2:*:*:*:*:*:*:*:* | 2.2.0 | Vulnerable | Pypdf2 Project |
- cpe:2.3:a:py-pdf:pypdf:*:*:*:*:*:*:*:* Versions before 3.9.0 Vulnerable ·py-pdf
- cpe:2.3:a:pypdf2_project:pypdf2:*:*:*:*:*:*:*:* Versions 2.2.0 Vulnerable ·Pypdf2 Project
Remediation
- Fix · GHSA-4vvm-4w3v-6mr8 pypdf (PyPI) Fixed in 3.9.0 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Quay v3 | Fixed | — |
Not affected: 1 product
- Quay v3
Timeline
- 2026-10-02 Threatist record created from CVE-2023-36464
- 2026-10-03 Alias added: GHSA-4vvm-4w3v-6mr8
- 2026-10-30 Affected versions changed · Red Hat
References
More py-pdf Pypdf vulnerabilities
- TI-2023-18601 Infinite Loop when reading malformed objects in pypdf CVSS 3.1MEDIUM 6.5
- TI-2026-42743 pypdf: Possible infinite loop for not terminated inline images CVSS 4.0HIGH 8.7
- TI-2026-42742 pypdf: Possible infinite loop for not terminated inline images (ASCII85 and ASCIIHex filter) CVSS 4.0HIGH 8.7
- TI-2026-65557 pypdf: Possible large memory usage when retrieving alphabetical page labels CVSS 4.0HIGH 8.7
- TI-2026-65556 pypdf: Possible long runtimes with large amount of embedded files CVSS 4.0HIGH 8.7
- TI-2026-65555 pypdf: Possible long runtimes when generating appearance streams CVSS 4.0HIGH 8.7
Sources
- CVE-2023-36464 · CVE Program
- CVE-2023-36464 · NVD
- FIRST EPSS
- GHSA-4vvm-4w3v-6mr8 · GitHub Advisory Database · CC BY 4.0
- CVE-2023-36464 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences