CVE-2022-24859
Pypdf2 Project Pypdf2 vulnerability
PyPDF2 is an open source python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files. In versions prior to 1.27.5 an attacker who uses this vulnerability can craft a PDF which leads to an infinite loop if the PyPDF2 if the code attempts to get the content stream. The reason is that the last while-loop in `ContentStream._readInlineImage` only terminates when it finds the `EI` token, but never actually checks if the stream has already ended. This issue has been resolved in version `1.27.5`. Users unable to upgrade should validate and PDFs prior to iterating over their content stream.
Affected products
Pypdf2, Debian Linux. The exact versions are in the references.
What to do now
- Check your exposureFind out whether Pypdf2 Project Pypdf2 runs anywhere in your environment, including systems of suppliers.
- UpdateInstall the version in which the vendor fixed the vulnerability. The references lead to the advisory.
- Set the orderSystems that can be reached from the internet come first, then the rest.
References
- github.com/py-pdf/PyPDF2/pull/740 · Patch
- github.com/py-pdf/PyPDF2/issues/329 · Exploit
- github.com/py-pdf/PyPDF2/releases/tag/1.27.5 · Third Party Advisory
- github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79 · Exploit
- lists.debian.org/debian-lts-announce/2022/06/msg00001.html · Third Party Advisory
- lists.debian.org/debian-lts-announce/2023/06/msg00013.html
- nvd.nist.gov/vuln/detail/CVE-2022-24859
- github.com/pypa/advisory-database/tree/main/vulns/pypdf2/PYSEC-2022-194.yaml
- nvd.nist.gov/vuln/detail/CVE-2022-24859
- cve.org/CVERecord?id=CVE-2022-24859
Data: CVE list and the NVD. This product uses data from the NVD API but is not endorsed or certified by the NVD.