CVE-2022-24859
A public proof of concept exists; no exploitation attested.
- Published2022-04-18
- WeaknessCWE-835
Am I affected?
Debian, Ubuntu or Red Hat sometimes backport a fix without changing the upstream version number: such a version reads « to verify », never « affected ».With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.
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.
Timeline
dates in UTC- 2022-04-1819:15CVE publishedNVD
Versions per branch
NVD · OSV| Branch | Affected | Fixed in | Source |
|---|---|---|---|
| 9.0 | = 9.0 | no fix published | NVD |
| Branch | Affected | Fixed in | Source |
|---|---|---|---|
| 1.27 | < 1.27.5 | 1.27.5 | NVD · OSV |
as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.
Products declared by the CNA1 product
As GitHub_M, the CNA that assigned this CVE, declared them in the CVE record; versions as written.
- py-pdf PyPDF2Affected
- = < 1.27.5no fix stated
Source: the CNA record (CVE Program), © The MITRE Corporation,CVE terms of useCVE recordupdated 2023-06-10
Distribution builds and vendor advisories
Packages from OSV.dev and products from the vendors' CSAF advisories.
version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.
Packages
- pypdf2Ubuntu:Pro:18.04:LTSall versions · fixed in 1.26.0-2ubuntu0.1~esm1
- pypdf2Ubuntu:Pro:16.04:LTSall versions · fixed in 1.25.1-1ubuntu0.1~esm1
- pypdf2Ubuntu:22.04:LTSall versions · fixed in 1.26.0-4ubuntu0.22.04.1
- pypdf2Ubuntu:20.04:LTSall versions · fixed in 1.26.0-3ubuntu1.20.04.1
- pypdf2Debian:12all versions · fixed in 1.27.9-1
- pypdf2Debian:10all versions · fixed in 1.26.0-2+deb10u1
- pypdf2Debian:9all versions · fixed in 1.26.0-2+deb9u1
- python-pypdf2Mageia:8all versions · fixed in 1.27.5-1.mga8
2 more package ranges on OSV.dev
Vendor advisories
PyPDF2: infinite loop vulnerability
quay/quay-rhel8 as a component of Red Hat Quay 3
Fix
- No fix available, says the vendor Red Hat Product Security CVE-2022-24859 · 1 productAffected
Advisories and patches
- github.comPatch
- github.comRelease Notes
Detection
- Nuclei template
- none so far ProjectDiscovery
- Exploit-DB
- no entry Exploit-DB
- Proof of concept
- CISA-ADP (SSVC)PoC stated2025-04-22
- PoC-in-GitHubno public repository identifiedread 2026-12-04
- Metasploit modules
- none listed Metasploit Framework
Sources
- CISA-ADPSSVC decisionpoc2025-04-22
- CNACVSS 3.16.2known since 2026-10-23
- NVDCVSS 3.15.5read 2026-10-23
- NVDCVSS 2.04.3read 2026-10-23
- CNAweakness (CWE)CWE-835known since 2026-10-23
- NVDweakness (CWE)CWE-835read 2026-10-23
- FIRST EPSSEPSS score1.3 %2026-12-04
- OSVaffected packages—
- GitHub AdvisoriesadvisoryModerate2022-04-22
Identifiers
- EUVD-2022-0214same flawENISA EUVD · LicenseRef-ENISA-legal-notice
- GHSA-xcjx-m2pj-8g79same flawGitHub Advisory Database · CC-BY-4.0
- PYSEC-2022-194same flawPyPA Advisory Database · CC-BY-4.0
- DLA-3039-1advisory covering several CVEsDebian · LicenseRef-unstated
- DLA-3451-1advisory covering several CVEsDebian · LicenseRef-unstated
- MGASA-2022-0224advisory covering several CVEsMageia · LicenseRef-unstated
- openSUSE-SU-2024:0366-1advisory covering several CVEsopenSUSE · LicenseRef-unstated
- USN-6176-1advisory covering several CVEsUbuntu
Technical details
- CVSS v3 vector
- CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
- Published
- 2022-04-18
- Last modified
- 2026-06-17
- NVD status
- Modified
- GitHub advisory
- GHSA-xcjx-m2pj-8g79
Frequently asked questions
What is CVE-2022-24859?
Is CVE-2022-24859 actively exploited?
What is the CVSS score for CVE-2022-24859?
Running pypdf2? Hear about its next vulnerability
Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».
No credit card required · No monthly cap on website checks · 250 API requests/month
Go further
- Following what attackers exploit right now? The CISA KEV additions of the month, with their patch deadlines.
- Running this software? Vulnerability monitoring alerts you to new vulnerabilities in your products.
Related vulnerabilities
Same product first, then the same vendor advisory and the same publication week.
- CVE-2023-36810same product
- CVE-2023-36807same product
- CVE-2026-134364same productpypdf 3.7.1 before 7.0.0 Placeholder Recovery via File Identifier in Encrypted Documents
- CVE-2025-55197same product
- CVE-2026-33699same product
- CVE-2026-134366same productpypdf before 7.0.0 Memory Exhaustion via Cross-Reference Streams with Identical Offsets
- CVE-2026-137549same productpypdf before 7.0.1 Excessive Memory Usage via Crafted PDF Images
- CVE-2026-28351same productManipulated RunLengthDecode streams can exhaust RAM
Sources for this record
- CVE Program · CVE Program Terms of Use
- ENISA EU Vulnerability Database · ENISA legal notice §1.2 (reproduction authorised, provided the source is acknowledged)
- FIRST EPSS · EPSS terms of use (free use, attribution requested)
- GitHub Advisory Database · CC-BY-4.0 · GHSA-xcjx-m2pj-8g79
- NVD · Public domain (17 U.S.C. § 105) for NVD-authored data; third-party content under its own terms
- OSV.dev · Per record, as its publisher states it: each row carries the label in sourceLicense when one is served
- Red Hat Product Security (CSAF and VEX) · CC-BY-4.0
- CISA Vulnrichment · CC0-1.0