pypdf: Uncontrolled resource consumption via oversized /ToUnicode tokens
Summary
pypdf is a pure-Python library for processing PDF files. A crafted PDF with unusually large source-code or destination-string tokens in a font /ToUnicode mapping can cause the library to decode and retain oversized values, for example during text extraction. An attacker can thereby exhaust memory and crash or slow down the processing application (denial of service). Exploitation requires that the application parses attacker-supplied PDF files with pypdf.
Affected
- pypdf versions before 6.18.1 (including 6.18.0)
Fixed in
- Upgrade to pypdf 6.18.1 or later.
Workaround
- No workaround is documented by the vendor.
- If an upgrade is not yet possible, apply the changes from PR #4071 (token length limits in parse_bfchar).
- Limit which PDF files reach pypdf, for example by restricting untrusted uploads.
Exploitation
- No public proof of concept or exploit code known.
- Not known to be exploited in the wild.
- CISA SSVC: exploitation none, automatable yes, technical impact partial.
Our recommendation
- Inventory all pypdf installations (pip freeze, requirements and lock files, container images).
- Upgrade to pypdf 6.18.1 at minimum, preferably the current release.
- Prioritise services that accept PDFs from external users or automated ingestion.
- Run PDF parsing with memory limits where possible and monitor for crashes or memory spikes.
Public exploits
PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.
Research sources
- GHSA-fp3h-c4fm-7vvf Security Advisory github.com
- Fix commit 319d0b8: Limit allowed length of tokens in parse_bfchar github.com
- Pull request #4071 github.com
- pypdf 6.18.1 release github.com
- OSV GHSA-fp3h-c4fm-7vvf osv.dev
- GitLab Advisory Database CVE-2026-102995 advisories.gitlab.com
- Ubuntu CVE tracker CVE-2026-102995 ubuntu.com
Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 1 Nov 2026, 06:27.
Original description (NVD)
pypdf is a free and open-source pure-python PDF library. Prior to 6.18.1, a crafted PDF can place unusually large source-code or destination-string tokens in a font /ToUnicode mapping, causing pypdf/_cmap.py parse_bfchar to decode and retain oversized values during operations such as text extraction and consume excessive memory. This is a second follow-up to earlier /ToUnicode resource-consumption fixes and is limited to the remaining token-length path. This issue is fixed in version 6.18.1.
Sources
The tracker combines official, freely usable data sources – updated continuously:
- NVD (NIST) – CVEs, rating (CVSS), affected products
- CISA KEV – vulnerabilities confirmed by CISA as actively exploited
- CISA Vulnrichment – CISA assessment (SSVC) in the official CVE record
- FIRST EPSS – probability of exploitation
- Microsoft MSRC – Patch Tuesday: vulnerabilities, severity, updates
- PoC-in-GitHub – public proof-of-concept repositories
- Metasploit (Rapid7) – modules of the Metasploit Framework
- Exploit-DB (OffSec) – archive of public exploits (links only)
- Patch days: official vendor pages (linked per vendor) (Vendor patch days)
This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.
Affected? We can help.
We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.
