CVE-2022-24859
published 2022-04-18CVE-2022-24859: 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…
PriorityP422medium5.5CVSS 3.1
AVLACLPRNUIRSUCNINAH
EPSS
1.28%
66.4th percentile
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.
Affected
7 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | debian_linux | — | — |
| debian | pypdf2 | < pypdf2 1.27.9-1 (bookworm) | pypdf2 1.27.9-1 (bookworm) |
| py-pdf | pypdf2 | < 1.27.5 | 1.27.5 |
| pypdf2_project | pypdf2 | < 1.27.5 | 1.27.5 |
| pypdf2_project | pypdf2 | >= 0 < 1.26.0-4+deb11u1 | 1.26.0-4+deb11u1 |
| pypdf2_project | pypdf2 | >= 0 < 1.27.9-1 | 1.27.9-1 |
| pypdf2_project | pypdf2 | >= 0 < 1.27.5 | 1.27.5 |
CVSS provenance
nvdv3.15.5MEDIUMCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
nvdv2.04.3MEDIUMAV:N/AC:M/Au:N/C:N/I:N/A:P
osv5.5MEDIUM
vendor_debian6.2MEDIUM
vendor_redhat6.2MEDIUM
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
OSV
Manipulated inline images can cause Infinite Loop in PyPDF2
osv·2022-04-22
CVE-2022-24859 [MEDIUM] Manipulated inline images can cause Infinite Loop in PyPDF2
Manipulated inline images can cause Infinite Loop in PyPDF2
### Impact
An attacker who uses this vulnerability can craft a PDF which leads to an infinite loop if the PyPDF2 user wrote the following code:
```python
from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.pdf import ContentStream
reader = PdfFileReader("malicious.pdf", strict=False)
for page in reader.pages:
ContentStream(page.getContents(), reader)
```
### Patches
[`PyPDF2==1.27.5`](https://pypi.org/project/PyPDF2) and later are patched.
Credits to [Sebastian Krause](https://github.com/sekrause) for finding ([issue](https://github.com/py-pdf/PyPDF2/issues/329)) and fixing ([PR](https://github.com/py-pdf/PyPDF2/pull/740)) it.
GHSA
Manipulated inline images can cause Infinite Loop in PyPDF2
ghsa·2022-04-22
CVE-2022-24859 [MEDIUM] CWE-835 Manipulated inline images can cause Infinite Loop in PyPDF2
Manipulated inline images can cause Infinite Loop in PyPDF2
### Impact
An attacker who uses this vulnerability can craft a PDF which leads to an infinite loop if the PyPDF2 user wrote the following code:
```python
from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.pdf import ContentStream
reader = PdfFileReader("malicious.pdf", strict=False)
for page in reader.pages:
ContentStream(page.getContents(), reader)
```
### Patches
[`PyPDF2==1.27.5`](https://pypi.org/project/PyPDF2) and later are patched.
Credits to [Sebastian Krause](https://github.com/sekrause) for finding ([issue](https://github.com/py-pdf/PyPDF2/issues/329)) and fixing ([PR](https://github.com/py-pdf/PyPDF2/pull/740)) it.
OSV
CVE-2022-24859: PyPDF2 is an open source python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files
osv·2022-04-18·CVSS 5.5
CVE-2022-24859 [MEDIUM] CVE-2022-24859: PyPDF2 is an open source python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files
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.
Ubuntu
PyPDF2 vulnerability
vendor_ubuntu·2023-06-19
CVE-2022-24859 PyPDF2 vulnerability
Title: PyPDF2 vulnerability
Summary: PyPDF2 could be made to crash if it opened a specially crafted
file.
It was discovered that PyPDF2 incorrectly handled certain PDF files. If a
user or automated system were tricked into processing a specially crafted
file, an attacker could possibly use this issue to consume system
resources, resulting in a denial of service.
Instructions: In general, a standard system update will make all the necessary changes.
Red Hat
PyPDF2: infinite loop vulnerability
vendor_redhat·2022-04-18·CVSS 6.2
CVE-2022-24859 [MEDIUM] CWE-835 PyPDF2: infinite loop vulnerability
PyPDF2: infinite loop vulnerability
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.
Package: quay/quay-rhel8 (Red Hat Quay 3) - Affected
Debian
CVE-2022-24859: pypdf2 - PyPDF2 is an open source python PDF library capable of splitting, merging, cropp...
vendor_debian·2022·CVSS 6.2
CVE-2022-24859 [MEDIUM] CVE-2022-24859: pypdf2 - PyPDF2 is an open source python PDF library capable of splitting, merging, cropp...
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.
Scope: local
bookworm: resolved (fixed in 1.27.9-1)
bullseye: resolved (fixed in 1.26.0-4+deb11u1)
No detection rules found.
No public exploits indexed.
No writeups or analysis indexed.
https://github.com/py-pdf/PyPDF2/issues/329https://github.com/py-pdf/PyPDF2/pull/740https://github.com/py-pdf/PyPDF2/releases/tag/1.27.5https://github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79https://lists.debian.org/debian-lts-announce/2022/06/msg00001.htmlhttps://lists.debian.org/debian-lts-announce/2023/06/msg00013.htmlhttps://github.com/py-pdf/PyPDF2/issues/329https://github.com/py-pdf/PyPDF2/pull/740https://github.com/py-pdf/PyPDF2/releases/tag/1.27.5https://github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79https://lists.debian.org/debian-lts-announce/2022/06/msg00001.htmlhttps://lists.debian.org/debian-lts-announce/2023/06/msg00013.html
2022-04-18
Published