jsPDF
CVE-2026-25755
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted text to app using jsPDF
-
DeliveryPayload escapes PDF JS string delimiter
-
ExploitInject /AA Additional Action object
-
ExecutionVictim opens generated PDF
-
PersistViewer auto-executes injected JavaScript
-
ImpactDocument actions altered / malicious script runs
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that a downstream application use jsPDF < 4.2.0 and pass attacker-influenced input into the addJS method (the exact vulnerable feature is document-level JavaScript embedding); the attacker payload must escape the PDF JS string delimiter using unescaped ')' followed by injected dictionary objects such as '/AA'. Per CVSS PR:N the attacker needs no authentication to the generating service, but UI:R applies: a victim must open the resulting PDF in a viewer that executes embedded JavaScript/Additional Actions (e.g. Adobe Acrobat) - viewers that ignore PDF JavaScript will not trigger the malicious action, which limits real-world impact. The decisive limiting factor is that the integrating developer must route unsanitized user input into addJS; default jsPDF usage with hardcoded/escaped JavaScript is not exploitable. |
| Impact | Signals are mixed and skew lower than the headline CVSS 8.8 suggests. The NVD vector (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H) treats this as a high-impact network issue, but it requires two real-world conditions: a developer must pass attacker-controlled input into addJS, and a victim must open the resulting PDF in a viewer that honors document JavaScript/Additional Actions (UI:R). EPSS is only 0.04% (10th percentile), there is no KEV listing, and the capability is JavaScript execution within a PDF viewer's scripting sandbox - not host remote code execution despite the 'RCE' tag. A public exploit/payload exists, raising practical likelihood for targeted abuse, but the very low EPSS and lack of active-exploitation evidence indicate this is a real-but-not-emergency priority. Note discrepancy to verify: the CVSS C/I/A:H rating assumes severe impact, yet actual impact is bounded by the opening viewer's JS sandbox, so 'High' on all three is arguably generous. |
| Exploit ScenarioDerived | An application lets users supply text (e.g. a filename, label, or note) that is embedded into a generated PDF's JavaScript via addJS. An attacker submits a payload such as "console.log('test');) >> /AA << /O << /S /JavaScript /JS (app.alert('Hacked!')) >> >>", which closes the JS string and dictionary and injects an Additional Action that fires when the document is opened. A public exploit/payload is published in the advisory, so when a victim opens the crafted PDF in a JavaScript-enabled reader the injected action executes automatically. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv5 – Jun 30, 2026
PDF object injection in the jsPDF JavaScript library (npm package 'jspdf', versions prior to 4.2.0) lets an attacker who controls the string passed to the addJS method break out of the PDF JavaScript string delimiter and inject arbitrary PDF dictionary objects, including auto-executing Additional Actions (/AA). Any user who later opens the generated PDF in a JavaScript-capable viewer executes the injected actions, affecting confidentiality, integrity and availability of their document session. Publicly available exploit code exists (a documented payload is published in the GitHub advisory), but EPSS is very low (0.04%, 10th percentile) and the issue is not in CISA KEV.
Earlier versions of this analysis (4)
PDF object injection in jsPDF (npm 'jspdf') before 4.2.0 lets an attacker who controls the string passed to the addJS() method break out of the JavaScript string delimiter and inject arbitrary PDF dictionary objects - including Additional Action (/AA) entries that auto-execute when the document is opened. Any application that feeds untrusted input into addJS() can be coerced into producing weaponized PDFs that act against anyone who opens them. Publicly available exploit code exists (CWE-94 code injection), though EPSS is very low (0.04%) and there is no evidence of active exploitation.
PDF object/code injection in the jsPDF JavaScript library (versions prior to 4.2.0) lets an attacker who controls the string passed to the addJS method break out of the JavaScript string delimiter and inject arbitrary PDF objects into the generated document. Any downstream user who opens the crafted PDF is impacted, as injected actions can alter document structure or trigger malicious behavior in the rendering viewer. A public PoC exists and a fixed release (4.2.0) is available, though EPSS exploitation probability remains very low (0.04%).
PDF object/JavaScript injection in the jsPDF JavaScript library (parallax/jsPDF) before 4.2.0 lets an attacker who controls the argument passed to the addJS method escape the JavaScript string delimiter and inject arbitrary PDF objects into the generated document, affecting any user who later opens that PDF. Tagged as code injection (CWE-94) with a CVSS 3.1 base score of 8.8; publicly available exploit code exists, though EPSS is very low (0.04%, 10th percentile) and there is no public exploit identified as actively used in the wild. Exploitation requires that the consuming application feed untrusted input into addJS, plus user interaction to open the resulting PDF.
jsPDF is a library to generate PDFs in JavaScript. Prior to 4.2.0, user control of the argument of the addJS method allows an attacker to inject arbitrary PDF objects into the generated document. [CVSS 8.1 HIGH]
RemediationAI
Vendor-released patch: 4.2.0 - upgrade the jspdf dependency to 4.2.0 or later (release https://github.com/parallax/jsPDF/releases/tag/v4.2.0, fixing commit 56b46d45b052346f5995b005a34af5dcdddd5437) and rebuild/redeploy any bundled front-end assets that vendor the library. Red Hat consumers should apply the platform errata RHSA-2026:7110 and RHSA-2026:7128. If you cannot upgrade immediately, the vendor-documented workaround is to escape parentheses in any user-provided JavaScript before passing it to addJS (replace '(' and ')' with their backslash-escaped forms, matching the library's own escapeParens logic), which neutralizes the string-breakout but must be applied consistently or it provides no protection; alternatively avoid feeding untrusted data into addJS at all, or strip/disallow document-level JavaScript in generated PDFs if the autoprint/scripting feature is not required, accepting the loss of that functionality.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
jsPDF is a browser/Node.js library that programmatically builds PDF files. The addJS method is meant to embed document-level JavaScript (e.g. an autoprint action) by wrapping the supplied code inside a PDF string object of the form '/JS (...)'. Because the PDF string syntax uses parentheses as delimiters, the pre-4.2.0 code inserted the raw user string without escaping '(' and ')'. This is a classic CWE-94 (Improper Control of Generation of Code / Code Injection) root cause: untrusted data is concatenated into a structured serialization context without sanitization, so a ')' prematurely closes the JS string and following bytes ('>>', '/AA << ... >>') are parsed by the PDF reader as new objects rather than literal data. The affected component is the parall/parallax jsPDF package (CPE cpe:2.3:a:parall:jspdf:*:*:*:*:*:node.js:*:*). The 4.2.0 fix adds an escapeParens() routine that backslash-escapes only unescaped parentheses (avoiding double-escaping), so the entire payload stays inside the string literal.
Know when Jspdf 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
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Network-delivered PDF (AV:N) with no auth (PR:N) but victim must open it (UI:R); primary effect is altering document structure/actions (I:H), with limited, viewer-sandboxed confidentiality and availability impact (C:L/A:L).
Primary rating from NVD.
CVSS VectorNVD
Lifecycle Timeline
8DescriptionNVD
jsPDF is a library to generate PDFs in JavaScript. Prior to 4.2.0, user control of the argument of the addJS method allows an attacker to inject arbitrary PDF objects into the generated document. By crafting a payload that escapes the JavaScript string delimiter, an attacker can execute malicious actions or alter the document structure, impacting any user who opens the generated PDF. The vulnerability has been fixed in jspdf@4.2.0. As a workaround, escape parentheses in user-provided JavaScript code before passing them to the addJS method.
Blast Radius
ecosystem impact- 2 npm packages depend on jspdf (2 direct, 0 indirect)
Ecosystem-wide dependent count for version 4.2.0.
Executive ViewAI
jsPDF versions prior to 4.2.0 contain a PDF object injection vulnerability; publicly available exploit code exists that allows attackers to inject malicious auto-executing PDF actions, potentially compromising user data and system integrity when recipients open documents in JavaScript-capable viewers. Organizations using jsPDF for PDF generation require immediate patching, particularly if applications accept untrusted input in PDF generation workflows.
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
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Affected Products (CPE)NVD
Denial of service in jsPDF (npm package, all versions prior to 4.2.0) lets an attacker who can supply image input to the
PDF generation in jsPDF prior to version 4.1.0 allows injection of arbitrary PDF objects through unsanitized input passe
Denial of service in jsPDF prior to version 4.1.0 occurs when malicious BMP files with oversized dimension headers are p
In all versions of the package jspdf, it is possible to use <<script>script> in order to go over the filtering regex. Ra
All affected versions <2.0.0 of package jspdf are vulnerable to Cross-site Scripting (XSS). Rated medium severity (CVSS
Jspdf versions up to 4.1.0 contains a vulnerability that allows attackers to inject arbitrary XML (CVSS 5.4).
Local file inclusion and path traversal in the Node.js builds of jsPDF (dist/jspdf.node.js and dist/jspdf.node.min.js) p
jsPDF versions prior to 4.1.0 contain a race condition in the addJS method where a shared module-scoped variable is over
jsPDF versions prior to 4.2.0 allow attackers to inject arbitrary PDF objects including malicious JavaScript through uns
This affects the package jspdf before 2.3.1. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable,
jsPDF is a library to generate PDFs in JavaScript. Rated high severity (CVSS 8.7), this vulnerability is remotely exploi
jsPDF is a library to generate PDFs in JavaScript. Rated high severity (CVSS 8.7), this vulnerability is remotely exploi
GHSA-9vjf-qc39-jprp
NVD
CVE.org
EPSS
VulDB
Exploit-DB