pypdf: Uncontrolled memory consumption via crafted /Widths array in fonts
Summary
pypdf is a pure-Python PDF library used by applications to read, split, merge and extract text from PDF files. Versions before 6.18.1 do not limit the /Widths array of TrueType and Type1 simple fonts, so a crafted PDF can make the parser consume excessive memory. An attacker who can get such a file processed by an application (for example through an upload form or email attachment) can cause a denial of service; no credentials are required and confidentiality and integrity are not affected.
Affected
- pypdf versions before 6.18.1 (Python package, PyPI)
Fixed in
- pypdf 6.18.1 (released 2026-09-11), fix: limit entry count for TrueType and Type1 font /Widths (PR #4072)
- Newer releases are available; check PyPI for the current version
Workaround
- No vendor workaround documented; the fix is the upgrade.
- Interim measure (suggestion): limit or sandbox processing of untrusted PDFs until upgraded.
Exploitation
- No evidence of exploitation in the wild found.
- CISA SSVC: Exploitation none, Automatable yes, Technical Impact partial.
- No public proof of concept found in our searches.
Our recommendation
- Inventory all pypdf installations, including requirements files, lockfiles, containers and transitive dependencies.
- Upgrade to pypdf 6.18.1 or later, preferably the current release, and cover the whole 6.18.1+ series.
- Restrict or sandbox processing of PDFs from untrusted sources until the upgrade is done.
- Ask software vendors whether their products bundle pypdf.
- Remove unused pypdf dependencies.
- Priority: medium; patch in the next maintenance window, sooner if pypdf parses untrusted PDFs on a server.
Public exploits
PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.
Research sources
- GitHub Security Advisory GHSA-g9cg-prrw-2r8q github.com
- Fix commit 0fb26eb8cdd01c44b3b2c9fe8329751be2f7cfd5 github.com
- Pull request #4072 github.com
- pypdf release 6.18.1 github.com
- GitLab Advisory Database CVE-2026-102996 advisories.gitlab.com
- OSV CVE-2026-102996 osv.dev
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:28.
Original description (NVD)
pypdf is a free and open-source pure-python PDF library. Prior to 6.18.1, a crafted PDF can provide a TrueType or Type1 simple font with an unusually large /Widths array, causing pypdf/_font.py Font._collect_tt_t1_character_widths to process entries beyond the 256 character codes meaningful for a simple font and consume excessive memory during operations such as text extraction. 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.
