Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft PDF with oversized /ToUnicode CMap tokens
-
DeliverySubmit PDF to pypdf-based service
-
Exploitparse_bfchar decodes/retains oversized values
-
ExecutionMemory exhaustion crashes worker
-
ImpactDenial of service
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption limits
MITRE ATT&CK
1 technique across 1 tactic: Impact The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires an application built on pypdf (versions prior to 6.18.1) to process an attacker-supplied PDF and invoke a code path that parses the font /ToUnicode CMap - most notably text extraction, which routes through _cmap.py parse_bfchar. The crafted PDF must contain unusually large source-code or destination-string tokens in the /ToUnicode mapping. No authentication or user interaction with the parser is required beyond getting the PDF ingested. Limiting factors: impact is confined to memory exhaustion (availability only, no code execution or data disclosure); deployments that never process untrusted PDFs, or that have already applied the two prior /ToUnicode resource-consumption fixes plus 6.18.1, are not exposed to this remaining token-length path. |
| Impact | This is a resource-consumption / denial-of-service issue (CWE-400) with no confidentiality or integrity impact - the vendor CVSS 4.0 vector (CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H) scores 8.7 driven solely by VA:H availability impact. The network vector and no-auth/no-interaction metrics reflect that the 'attacker' input is simply a crafted PDF file, so realistic exploitability depends entirely on whether an application feeds untrusted PDFs into pypdf and calls parsing/text-extraction paths. Exploitation status: no public exploit identified at time of analysis (no KEV listing and no EPSS score were provided in the input); the PR does include regression tests that reproduce the oversized-token behavior, which functions as a working proof-of-condition but not a weaponized exploit. The 8.7 rating overstates real-world urgency somewhat: this is a memory-exhaustion DoS in a library, not remote code execution, and it is the third incremental fix ('second follow-up') closing a remaining token-length path after earlier /ToUnicode hardening - indicating a narrow residual bug rather than a broad new attack surface. Treat as a real but non-critical priority: patch promptly in any service that processes untrusted PDFs, lower urgency for offline/trusted-input use. |
| Exploit ScenarioDerived | An attacker submits a malicious PDF to a service that uses pypdf (e.g. a document-upload, indexing, or text-extraction pipeline). The PDF embeds a font /ToUnicode CMap containing unusually large source-code or destination-string tokens; when pypdf's _cmap.py parse_bfchar decodes and retains these oversized values during text extraction, memory consumption balloons, degrading or crashing the worker process. No public weaponized exploit exists, but the fix PR ships regression tests demonstrating the oversized-token condition. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 30, 2026
Memory exhaustion in pypdf versions prior to 6.18.1 allows unauthenticated remote attackers to crash or degrade any application that parses attacker-supplied PDFs, by embedding oversized source-code or destination-string tokens inside a font /ToUnicode CMap. Processing such a file (for example during text extraction, which routes through pypdf/_cmap.py parse_bfchar) makes the library decode and retain these oversized values, driving availability-impacting memory consumption with no confidentiality or integrity effect. The vendor CVSS 4.0 vector (8.7, VA:H only, PR:N/UI:N) matches the assessed CVSS 3.1 vector of AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H; no public exploit code or KEV-listed active exploitation was identified at time of analysis, and a vendor-released patch (6.18.1) is available.
RemediationAI
Vendor-released patch: upgrade pypdf to 6.18.1 or later, which enforces MAX_CMAP_CODE_BYTES_LIMIT (16 bytes) and MAX_CMAP_STRING_BYTES_LIMIT (1024 bytes) in parse_bfchar/parse_bfrange and raises LimitReachedError instead of retaining oversized tokens; see the advisory at https://github.com/py-pdf/pypdf/security/advisories/GHSA-fp3h-c4fm-7vvf, the fix in https://github.com/py-pdf/pypdf/pull/4071 (commit https://github.com/py-pdf/pypdf/commit/319d0b823ce2c311a2435e9fd93c13994d32bb51), and the release at https://github.com/py-pdf/pypdf/releases/tag/6.18.1. Because this is only the last remaining token-length path of a series of /ToUnicode fixes, confirm that earlier fixes are also present rather than backporting this commit in isolation. If immediate upgrade is not possible, the actionable compensating controls are: avoid invoking text-extraction or any /ToUnicode-dependent parsing on untrusted PDFs (trade-off: loss of text-search/indexing functionality for those documents); run the parsing workload in a sandboxed worker with a hard memory cap and OOM-kill (for example a container memory limit or ulimit -v), so exhaustion terminates only the worker rather than the host (trade-off: attackers can still force repeated worker restarts and consume a share of capacity); and impose request timeouts plus per-document size and queue limits at the ingestion boundary to bound how many crafted files can be processed concurrently (trade-off: legitimate large PDFs may be rejected or slowed). Blocking or sanitizing font /ToUnicode entries before handing PDFs to pypdf is possible but brittle, since legitimate documents rely on that mapping for correct text rendering.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
pypdf is a pure-Python PDF library (CPE cpe:2.3:a:py-pdf:pypdf, CWE-400 uncontrolled resource consumption). The flaw lives in the /ToUnicode CMap parser: PDF fonts may include a /ToUnicode character map that maps character codes to Unicode strings, and pypdf parses it in pypdf/_cmap.py. The parser walks bfchar and bfrange sections, splitting each line into source-code and destination-string tokens, hex-decoding them (unhexlify) and adding entries to an in-memory mapping dictionary. Prior fixes already capped the number of iterations and some resource paths; this third issue is the remaining token-length path, where an attacker crafts a mapping line whose source token or destination string is far larger than any legitimate CMap entry. The upstream patch (PR #4071, commit 319d0b823ce2c311a2435e9fd93c13994d32bb51) introduces a _check_token_length helper with MAX_CMAP_CODE_BYTES_LIMIT (16 bytes) and MAX_CMAP_STRING_BYTES_LIMIT (1024 bytes) and raises LimitReachedError on violation, while also hardening adjacent parsing: empty lines are skipped with a warning, odd-length token lists are truncated with a warning, the destination token is length-checked before unhexlify/decode, and the previous broad 'except (ValueError, IndexError)' was narrowed to ValueError. The test suite added in the same PR demonstrates the exact failure boundaries (e.g. 'Maximum /ToUnicode code length exceeded: 18 > 16' and 'Maximum /ToUnicode string length exceeded: 1026 > 1024'). The root cause class is unbounded input-driven memory retention, not memory corruption, so exploitation yields denial of service rather than code execution or data exposure.
Know when Pypdf gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Untrusted PDF is remotely supplied (AV:N) and trivially crafted (AC:L, no auth/interaction); impact is memory-exhaustion DoS only, so C:N/I:N/A:H, scope unchanged.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
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.
Blast Radius
ecosystem impact- 2 pypi packages depend on pypdf (2 direct, 0 indirect)
Ecosystem-wide dependent count for version 6.18.1.
Technical POC Analysis
Evidence note: the supplied material is the GitHub advisory plus the CVE metadata.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
pypdf versions prior to 6.18.1 are vulnerable to a memory exhaustion flaw that can crash or degrade any application parsing attacker-supplied PDFs, leading to denial of service. This affects organizations that process PDFs from untrusted sources, potentially disrupting critical business services and customer-facing operations. Leadership should prioritize patching to maintain service availability and prevent operational disruptions.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Infinite loop denial of service in pypdf prior to 6.16.0 allows any attacker who can supply a crafted PDF to a pypdf-bas
pypdf is a pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files. Rat
pypdf is a pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files. Rat
pypdf is an open source, pure-python PDF library. Rated medium severity (CVSS 5.5), this vulnerability is no authenticat
Resource exhaustion in pypdf prior to 6.16.1 allows an attacker who can supply a crafted PDF to cause denial of service
Memory exhaustion in pypdf versions prior to 6.19.0 allows a remote, unauthenticated attacker to make an application una
Denial of service in pypdf versions prior to 6.19.0 allows an unauthenticated remote attacker to pin a PDF-processing wo
Denial of service in pypdf versions prior to 6.19.0 allows remote, unauthenticated attackers to exhaust application CPU
Denial of service in pypdf before 6.18.1 lets a crafted PDF drive the library's FlateDecode recovery path into inefficie
Memory exhaustion in pypdf versions prior to 6.18.1 lets a crafted PDF force the library to allocate and process far mor
Denial of service in pypdf versions prior to 6.18.0 allows remote, unauthenticated attackers to stall PDF parsing by sup
Memory-exhaustion denial of service in pypdf versions prior to 6.17.0 allows remote attackers to inflate application mem
EUVD-2026-90367
GHSA-fp3h-c4fm-7vvf
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB