Skip to main content

pypdf CVE-2026-71852

| EUVDEUVD-2026-54600 MEDIUM
Excessive Iteration (CWE-834)
2026-08-07 https://github.com/py-pdf/pypdf GHSA-fwg2-594c-jp42
4.8
CVSS 4.0 · Vendor: https://github.com/py-pdf/pypdf
Share

Severity by source

Vendor (https://github.com/py-pdf/pypdf) PRIMARY
4.8 MEDIUM
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
vuln.today AI
7.5 HIGH

PDF delivered over network with no auth required; automated library processing requires no user interaction; impact is availability-only resource exhaustion with no C or I effect.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE
5.5 MEDIUM
AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Red Hat
5.5 MEDIUM
qualitative

Primary rating from Vendor (https://github.com/py-pdf/pypdf).

CVSS VectorVendor: https://github.com/py-pdf/pypdf

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
P
Scope
X

Lifecycle Timeline

3
CVSS changed
Aug 07, 2026 - 19:22 NVD
4.8 (MEDIUM)
Source Code Evidence Fetched
Aug 07, 2026 - 19:20 vuln.today
Analysis Generated
Aug 07, 2026 - 19:20 vuln.today

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 45 pypi packages depend on pypdf (9 direct, 36 indirect)

Ecosystem-wide dependent count for version 6.15.0.

DescriptionCVE.org

Impact

An attacker who uses this vulnerability can craft a PDF which leads to long runtimes and large memory consumption. This requires parsing the font width entries of a font with unusually large values, for example during text extraction.

Patches

This has been fixed in pypdf==6.15.0.

Workarounds

If you cannot upgrade yet, consider applying the changes from PR #3946.

AnalysisAI

Resource exhaustion in pypdf before 6.15.0 enables denial of service via crafted PDF files containing CID font width entries with maliciously large range values. Any application that processes untrusted PDFs using pypdf's text extraction or font parsing routines is affected, as the library iterates over attacker-controlled CID width ranges without bounds enforcement, consuming excessive CPU and memory. No public exploit code has been identified at time of analysis, and this vulnerability is not listed in the CISA KEV catalog.

Technical ContextAI

pypdf (pkg:pip/pypdf) is a pure-Python library for reading, writing, and manipulating PDF files. The vulnerability resides in pypdf/_font.py within the _collect_cid_character_widths function, which processes the /W (Widths) array of CID (Character Identifier) fonts embedded in PDF documents. CID fonts describe character advance widths using two encoding formats: a range format (start_cid, end_cid, single_width) and a list format (start_cid, [width1, width2, ...]). Prior to the fix, no upper bounds were enforced on range sizes or total entry counts, meaning an attacker could encode a /W array with a range spanning billions of CID values. CWE-834 (Excessive Iteration) precisely describes the root cause: the parser faithfully iterates over the attacker-supplied range, attempting to allocate and populate a massive dictionary of character widths until memory or CPU is exhausted. The fix in PR #3946 introduces two hard limits: MAX_CID_WIDTH_ENTRY_COUNT = 65,536 per individual range and MAX_WIDTH_ENTRY_COUNT = 100,000 cumulative entries, raising LimitReachedError when either threshold is exceeded.

RemediationAI

Upgrade pypdf to version 6.15.0 or later, which introduces enforced limits on CID font width entries and raises LimitReachedError for inputs that exceed them (https://github.com/py-pdf/pypdf/releases/tag/6.15.0). If an immediate upgrade is not possible, the fix can be applied manually by backporting the changes from PR #3946 (https://github.com/py-pdf/pypdf/pull/3946) or commit 51cb6acf9e8a35b77e90b4d87d28fe3e1416d7d7, which adds the MAX_CID_WIDTH_ENTRY_COUNT and MAX_WIDTH_ENTRY_COUNT guards to pypdf/_font.py. As a compensating control for services that cannot upgrade, enforce OS-level resource constraints on PDF-processing workers using cgroups or ulimit (e.g., memory cap, CPU time limit) - note this mitigates impact by causing process termination rather than fixing the root cause, and will degrade availability for legitimate large PDFs as well. Additionally, restricting PDF uploads by file size or source IP reduces the attack surface without eliminating the vulnerability.

Vendor StatusVendor

SUSE

Severity: Moderate

Share

CVE-2026-71852 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy