CVE-2022-24859
published medium CVSS 3.1 · 6.2Manipulated inline images can cause Infinite Loop in PyPDF2
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| py-pdf | — | PyPDF2< 1.27.5 | Affected | Not stated | GitHub_M |
| Debian | buster | pypdf2 | Advisory build | 1.26.0-2+deb10u1 | DLA-3451-1 |
| SUSE / openSUSE | openSUSE-Leap-15.6 | python3-PyPDF2noarch | Advisory build | 1.26.0-bp156.4.3.1 | OPENSUSE-SU-2024:0366-1 |
| Ubuntu | bionic | pypdf2 | Advisory build | 1.26.0-2ubuntu0.1~esm1 | USN-6176-1 |
| Debian | stretch | pypdf2 | Advisory build | 1.26.0-2+deb9u1 | DLA-3039-1 |
| Ubuntu | bionic | python-pypdf2 | Advisory build | 1.26.0-2ubuntu0.1~esm1 | USN-6176-1 |
| Ubuntu | bionic | python3-pypdf2 | Advisory build | 1.26.0-2ubuntu0.1~esm1 | USN-6176-1 |
| Ubuntu | focal | pypdf2 | Advisory build | 1.26.0-3ubuntu1.20.04.1 | USN-6176-1 |
Show 7 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Ubuntu | focal | python-pypdf2 | Advisory build | 1.26.0-3ubuntu1.20.04.1 | USN-6176-1 |
| Ubuntu | focal | python3-pypdf2 | Advisory build | 1.26.0-3ubuntu1.20.04.1 | USN-6176-1 |
| Ubuntu | jammy | pypdf2 | Advisory build | 1.26.0-4ubuntu0.22.04.1 | USN-6176-1 |
| Ubuntu | jammy | python3-pypdf2 | Advisory build | 1.26.0-4ubuntu0.22.04.1 | USN-6176-1 |
| Ubuntu | xenial | pypdf2 | Advisory build | 1.25.1-1ubuntu0.1~esm1 | USN-6176-1 |
| Ubuntu | xenial | python-pypdf2 | Advisory build | 1.25.1-1ubuntu0.1~esm1 | USN-6176-1 |
| Ubuntu | xenial | python3-pypdf2 | Advisory build | 1.25.1-1ubuntu0.1~esm1 | USN-6176-1 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 6.2 / 10
- Severity
- medium
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| py-pdf | PyPDF2 | < 1.27.5 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-835 CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
References
6- https://github.com/py-pdf/PyPDF2/issues/329
- https://github.com/py-pdf/PyPDF2/pull/740
- https://github.com/py-pdf/PyPDF2/releases/tag/1.27.5
- https://github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79
- [debian-lts-announce] 20220603 [SECURITY] [DLA 3039-1] pypdf2 security update https://lists.debian.org/debian-lts-announce/2022/06/msg00001.html
- [debian-lts-announce] 20230609 [SECURITY] [DLA 3451-1] pypdf2 security update https://lists.debian.org/debian-lts-announce/2023/06/msg00013.html
Provider assertions
3GitHub_M · cna
Manipulated inline images can cause Infinite Loop in PyPDF2
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 17202d0f09c991f15fa0394150add4277a582202a3d108d5c48777b394b9557d
- Ingested
- 23 Sep 2026, 07:58:57 UTC
- Source record
- Official CVE record