CVE-2022-24859

NameCVE-2022-24859
DescriptionPyPDF2 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.
SourceCVE (at NVD; CERT, LWN, oss-sec, fulldisc, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)
ReferencesDLA-3039-1, DLA-3451-1
Debian Bugs1009879

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
pypdf2 (PTS)bullseye1.26.0-4+deb11u1fixed
bookworm2.12.1-3+deb12u1fixed
sid2.12.1-4fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
pypdf2sourcestretch1.26.0-2+deb9u1DLA-3039-1
pypdf2sourcebuster1.26.0-2+deb10u1DLA-3451-1
pypdf2sourcebullseye1.26.0-4+deb11u1
pypdf2source(unstable)1.27.9-11009879

Notes

https://github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79
https://github.com/py-pdf/PyPDF2/issues/329
https://github.com/py-pdf/PyPDF2/pull/740

Search for package or bug name: Reporting problems