{"id":"CVE-2022-24859","published":"2022-04-18T00:00:00Z","modified":"2025-04-22T18:15:17Z","title":"Manipulated inline images can cause Infinite Loop in PyPDF2","vendor":"py-pdf","product":"PyPDF2","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.2,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01328,"percentile":0.71716,"provenance":"source"},"cwes":[{"id":"CWE-835","name":"Loop with Unreachable Exit Condition"}],"references":[{"url":"https://github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79","tags":[]},{"url":"https://github.com/py-pdf/PyPDF2/issues/329","tags":[]},{"url":"https://github.com/py-pdf/PyPDF2/pull/740","tags":[]},{"url":"https://github.com/py-pdf/PyPDF2/releases/tag/1.27.5","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2022/06/msg00001.html","tags":["mailing-list"]},{"url":"https://lists.debian.org/debian-lts-announce/2023/06/msg00013.html","tags":["mailing-list"]}],"priority":{"score":18.7,"factors":[{"name":"EPSS percentile","points":14.34},{"name":"CVSS severity","points":4.34}]},"vendorSlug":"py-pdf","affectedVersions":[{"vendor":"py-pdf","product":"PyPDF2","versions":["< 1.27.5"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2025-04-22T15:48:47.752836Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"PyPDF2","vulnerableRanges":["<1.27.5"],"patched":["1.27.5"],"from":["GHSA-xcjx-m2pj-8g79","PYSEC-2022-194"],"provenance":"source"}],"summary":{"text":"PyPDF2 (from py-pdf) contains a flaw in the ContentStream._readInlineImage routine, which only exits when it encounters the EI token and never checks whether the stream has ended, so an infinite loop can occur when content streams are read. An attacker who can supply a crafted PDF to the affected code, with no privileges and no user interaction required, can cause a denial of service that hangs the process; the flaw is fixed in version 1.27.5, and users who cannot upgrade should validate PDFs before iterating over their content streams.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T20:35:07Z"},"euvd":{"id":"EUVD-2022-0214","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2022-24859","published":"2022-04-18","fixed":"1.27.5","kev":false},{"cve":"CVE-2023-36810","published":"2023-06-30","fixed":"1.27.9","kev":false,"link":{"from":"CVE-2022-24859","to":"CVE-2023-36810","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:PyPDF2","fromFixed":"1.27.5","toFixed":"1.27.9","daysApart":438}]}},{"cve":"CVE-2023-36807","published":"2023-06-30","fixed":"2.10.6","kev":false},{"cve":"CVE-2023-36464","published":"2023-06-27","fixed":"3.9.0","kev":false}],"package":"PyPI:PyPDF2"}}