GHSA-fp3h-c4fm-7vvf: Pip/pypdf vulnerability
Impact
An attacker who uses this vulnerability can craft a PDF which leads to large memory consumption. This requires parsing the /ToUnicode entry of a font with unusually large values, for example during text extraction.
Patches
This has been fixed in pypdf==6.18.1.
Workarounds
If you cannot upgrade yet, consider applying the changes from PR #4071.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/pypdfto a version that resolves this vulnerability.Fixed in 6.18.1 - Upgrade
Upgrade
pypdfto a version that resolves this vulnerability.Fixed in 6.18.1
Event History
Frequently Asked Questions
What conditions are required for exploitation?
An attacker must be able to supply a crafted PDF that your application parses. The issue is triggered when pypdf parses a font's /ToUnicode entry containing unusually large values, such as during text extraction.
Which deployments are most exposed?
Deployments that accept PDFs from untrusted sources and perform text extraction or otherwise parse font /ToUnicode mappings are exposed to the described memory-consumption condition.
What can be done if upgrading is not immediately possible?
Consider applying the changes from PR #4071 as a workaround until an upgrade is possible.