CVE-2022-24859Manipulated inline images can cause Infinite Loop in PyPDF2
- 6.2MediumCVSS base score
- 1.3%Exploitation in 30 daysEPSS · top 29% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- YesPublic exploitsa reference or SSVC says so
Description
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.
Public exploit
An exploit or proof of concept is public: anyone can try it against an unpatched system. CISA's SSVC rates its exploitation: a proof of concept is public.
Timeline
ID reserved
By GitHub_M
- 2 months later
· 2 months later
Published
- 3 years later
· 3 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_MCNA (assigner) | 3.1 | Medium6.2 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVDNVD · Modified | 3.1 | Medium5.5 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
- EPSS (exploitation in 30 days)
- 1.3% · top 29% of all CVEs (16 Nov 2026)
- CISA SSVC
- Exploitation: poc · Automatable: no · Technical impact: partial
The list uses the assigner's score when there is one, then CISA's, then NVD's: Medium 6.2.
Affected products
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- PyPIPyPDF2GHSA-xcjx-m2pj-8g79 (opens in a new tab)
References
References6
- https://github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79 (opens in a new tab)x_transferred
- https://github.com/py-pdf/PyPDF2/issues/329 (opens in a new tab)x_transferred
- https://github.com/py-pdf/PyPDF2/pull/740 (opens in a new tab)x_transferred
- https://github.com/py-pdf/PyPDF2/releases/tag/1.27.5 (opens in a new tab)x_transferred
- [debian-lts-announce] 20220603 [SECURITY] [DLA 3039-1] pypdf2 security update (opens in a new tab)mailing-listx_transferred
- [debian-lts-announce] 20230609 [SECURITY] [DLA 3451-1] pypdf2 security update (opens in a new tab)mailing-listx_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2022-0214 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-xcjx-m2pj-8g79 (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2022-24859)Record last updated .