CVE-2023-36464: Infinite Loop when a comment isn't followed by a character in pypdf
Published Jun 27, 2023
·Updated
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 parsecontentstream 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/datastructures.py to while peek not in (b"\r", b"\n", b"").
Affected Software
2 affected components
Pypdf Project Pypdf<3.9.0
Pypdf2 Project Pypdf2>=2.2.0
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
If unable to upgrade, modify the loop condition in pypdf/generic/_data_structures.py from `while peek not in (b"\r", b"\n")` to `while peek not in (b"\r", b"\n", b"")`.
pypdf (pypdf/generic/_data_structures.py) - __parse_content_stream while peek not in (b"\r", b"\n") = while peek not in (b"\r", b"\n", b"")
Event History
Jun 27, 2023
CVE Published
via MITRE·09:24 PM
Data Sourced
via MITRE·09:24 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:15 PM
RemedyDescriptionSeverityWeaknessAffected Software