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

- Severity: Medium 6.2 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.35%, higher than 30% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2023-06-27T21:24:30.685Z
- Modified: 2026-11-02T16:06:04.477Z
- Also known as: GHSA-4vvm-4w3v-6mr8, PYSEC-2026-1835, PYSEC-2026-3008
- Weaknesses: CWE-835
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- py-pdf pypdf:  pypdf: < 3.90; PyPDF2: >= 2.2.0; before 3.9.0
- pypdf (PyPI): from 3.1.0 before 3.9.0
- pypdf2 (PyPI): from 2.2.0 up to 3.0.1; from 2.2.0 before 3.9.0
- pypdf2_project pypdf2: from 2.2.0

## Every score

- GitHub_M: CVSS:3.1 6.2 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.1 6.2 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`
- PyPA Advisory Database: CVSS:3.1 6.2 Medium `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> (exploit, patch, web)
- <https://github.com/py-pdf/pypdf/pull/1828> (patch, web)
- <https://github.com/py-pdf/pypdf/pull/969> (issue-tracking, patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-36464> (advisory)
- <https://github.com/py-pdf/pypdf/commit/b0e5c689df689ab173df84dacd77b6fc3c161932> (fix, web)
- <https://github.com/py-pdf/pypdf> (package)
- <https://github.com/py-pdf/pypdf/releases/tag/3.9.0> (web)
- <https://pypi.org/project/pypdf2> (package)
- <https://github.com/advisories/GHSA-4vvm-4w3v-6mr8> (advisory)
- <https://pypi.org/project/pypdf> (package)

## Sources

- CVE List: [CVE-2023-36464](https://www.cve.org/CVERecord?id=CVE-2023-36464), CVE Terms of Use, modified 2024-12-03
- GitHub Advisory Database: [GHSA-4vvm-4w3v-6mr8](https://github.com/advisories/GHSA-4vvm-4w3v-6mr8), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2023-36464](https://nvd.nist.gov/vuln/detail/CVE-2023-36464), Public domain, modified 2026-11-02
- PyPA Advisory Database: [PYSEC-2026-1835](https://osv.dev/vulnerability/PYSEC-2026-1835), CC-BY-4.0, modified 2026-07-13
- PyPA Advisory Database: [PYSEC-2026-3008](https://osv.dev/vulnerability/PYSEC-2026-3008), CC-BY-4.0, modified 2026-07-13

---

Page: https://cve.day/CVE-2023-36464 · Whole record: https://cve.day/CVE-2023-36464.json · Rebuilt by cve.day 2026-11-25T22:58:25.260Z
