Headline
GHSA-jrm6-h9cq-8gqw: PyPDF2 quadratic runtime with malformed PDF missing xref marker
Impact
An attacker who uses this vulnerability can craft a PDF which leads to unexpected long runtime. This quadratic runtime blocks the current process and can utilize a single core of the CPU by 100%. It does not affect memory usage.
Patches
https://github.com/py-pdf/pypdf/pull/808
Workarounds
Is there a way for users to fix or remediate the vulnerability without upgrading?
References
PyPDF2 quadratic runtime with malformed PDF missing xref marker
Moderate severity GitHub Reviewed Published Jun 30, 2023 in py-pdf/pypdf • Updated Jun 30, 2023
Related news
Ubuntu Security Notice 6280-1 - It was discovered that PyPDF2 incorrectly handled PDF files with certain markers. 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.
pypdf is a pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files. An attacker who uses this vulnerability can craft a PDF which leads to unexpected long runtime. This quadratic runtime blocks the current process and can utilize a single core of the CPU by 100%. It does not affect memory usage. This issue has been addressed in PR 808 and versions from 1.27.9 include this fix. Users are advised to upgrade. There are no known workarounds for this vulnerability.