CVE-2022-24859
MEDIUM 5.5CVSS 3.1Manipulated inline images can cause Infinite Loop in PyPDF2
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.
- Published
- 18 Apr 2022
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-835
- Also known as
- GHSA-xcjx-m2pj-8g79PYSEC-2022-194
- Sources
- NVDJSONOSV GHSA-xcjx-m2pj-8g79JSONOSV PYSEC-2022-194JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N | |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 6.2 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| OSV | GitHub | CVSS 3.1 | MEDIUM 6.2 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 5.5 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 4.3 | AV:N/AC:M/Au:N/C:N/I:N/A:P |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | pypdf2_project | pypdf2cpe:2.3:a:pypdf2_project:pypdf2:*:*:*:*:*:*:*:* |
< 1.27.5 | 1.27.5 |
| NVD | debian | debian_linuxcpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* |
= 9.0 | |
| OSV | PyPI | pypdf2 | < 1.27.5 | 1.27.5 |
References
- https://github.com/py-pdf/PyPDF2/issues/329 · Exploit, Third Party Advisory, WEB, REPORT
- https://github.com/py-pdf/PyPDF2/pull/740 · Patch, Third Party Advisory, WEB
- https://github.com/py-pdf/PyPDF2/releases/tag/1.27.5 · Release Notes, Third Party Advisory, WEB
- https://github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79 · Exploit, Third Party Advisory, WEB, ADVISORY
- https://lists.debian.org/debian-lts-announce/2022/06/msg00001.html · Mailing List, Third Party Advisory, WEB
- https://lists.debian.org/debian-lts-announce/2023/06/msg00013.html · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2022-24859 · ADVISORY
- https://github.com/py-pdf/PyPDF2 · PACKAGE
- https://github.com/pypa/advisory-database/tree/main/vulns/pypdf2/PYSEC-2022-194.yaml · WEB
History
- 25 Nov 2026 20:34 UTC · NVD: first stored (published 18 Apr 2022)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 18 Apr 2022)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 22 Apr 2022)