CVE-2022-24859
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.
Predictions
Heuristic predictions, AS-IS, for prioritization only.
Mitigations
No mitigations published for this CVE yet.
The vendor-content worker queues fetches as references arrive (check back in a few minutes). Or โ if you've already worked around this in production โ publish your fix to the community-verified tier.
โ Propose a mitigation on Community โ Mitigations published via the community go through AI scoring + 2 human reviewers + 7-day silent objection window before landing here withsource_tier=community-verified.
OS impact
Debian Fixed 2 releases
| Version | Status | Fixed in |
|---|---|---|
| bullseye | Fixed | 1.26.0-4+deb11u1 |
| bookworm | Fixed | 1.27.9-1 |
Package impact
| Ecosystem | Package | Vulnerable | Fixed |
|---|---|---|---|
| PyPI | pypdf2 | <1.27.5 | 1.27.5 |
References
- https://github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79
- https://nvd.nist.gov/vuln/detail/CVE-2022-24859
- https://github.com/py-pdf/PyPDF2/issues/329
- https://github.com/py-pdf/PyPDF2/pull/740
- https://github.com/py-pdf/PyPDF2
- https://github.com/py-pdf/PyPDF2/releases/tag/1.27.5
- https://github.com/pypa/advisory-database/tree/main/vulns/pypdf2/PYSEC-2022-194.yaml
- https://lists.debian.org/debian-lts-announce/2022/06/msg00001.html
- https://lists.debian.org/debian-lts-announce/2023/06/msg00013.html
- https://security-tracker.debian.org/tracker/CVE-2022-24859
Community-verified mitigations for this CVE will appear above when contributors publish them.
Verify integrity in audit chain (admin only). AS-IS.