Infinite loop in PyPDF - CVE-2022-24859
Published: June 19, 2023 / Updated: April 10, 2026
Vulnerability details
The vulnerability allows a remote attacker to perform a denial of service (DoS) attack.
The vulnerability exists due to infinite loop in ContentStream._readInlineImage. A remote attacker can pass a specially crafted PDF file to the application, consume all available system resources and cause denial of service conditions.
Affected software
Ubuntu
python3-pypdf2 (Ubuntu package)
python-pypdf2 (Ubuntu package)
How to mitigate CVE-2022-24859
python3-pypdf2 (Ubuntu package) - addressed in versions Ubuntu Pro, 1.26.0-3ubuntu1.20.04.1, 1.26.0-4ubuntu0.22.04.1
python-pypdf2 (Ubuntu package) - addressed in versions Ubuntu Pro, 1.26.0-3ubuntu1.20.04.1
External References
- https://github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79
- https://github.com/py-pdf/PyPDF2/pull/740
- https://github.com/py-pdf/PyPDF2/issues/329
- https://github.com/py-pdf/PyPDF2/releases/tag/1.27.5
- https://lists.debian.org/debian-lts-announce/2022/06/msg00001.html
- https://lists.debian.org/debian-lts-announce/2023/06/msg00013.html
- https://github.com/py-pdf/pypdf/security/advisories/GHSA-xcjx-m2pj-8g79