Skip to main content

jsPDF CVE-2026-25755

HIGH
Code Injection (CWE-94)
2026-02-19 security-advisories@github.com GHSA-9vjf-qc39-jprp
8.8
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit crafted text to app using jsPDF
  2. Delivery
    Payload escapes PDF JS string delimiter
  3. Exploit
    Inject /AA Additional Action object
  4. Execution
    Victim opens generated PDF
  5. Persist
    Viewer auto-executes injected JavaScript
  6. Impact
    Document 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv5 – 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)
v4 Jun 30, 2026 - 05:39 cvss changed CVSS 8.8

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.

v3 Jun 30, 2026 - 05:39 cvss changed CVSS 8.8

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%).

v2 Jun 30, 2026 - 05:38 cvss changed CVSS 8.8

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.

v1 Mar 12, 2026 - 22:03 CVSS 8.1

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

npm jspdf fix: 4.2.0

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

NVD PRIMARY 8.8 HIGH
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
vuln.today AI 7.6 HIGH

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).

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:L
4.0 AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N
Red Hat 9.6 HIGH

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

8
Analysis Updated
Jun 30, 2026 - 05:40 vuln.today
v5 - CVSS changed
Analysis Updated
Jun 30, 2026 - 05:39 vuln.today
v4 - CVSS changed
Analysis Updated
Jun 30, 2026 - 05:39 vuln.today
v3 - CVSS changed
Analysis Updated
Jun 30, 2026 - 05:38 vuln.today
v2 - CVSS changed
CVSS changed
Jun 30, 2026 - 03:23 NVD
8.1 (HIGH) 8.8 (HIGH)
PoC Detected
Feb 23, 2026 - 18:52 vuln.today
Public exploit code
Patch released
Feb 23, 2026 - 18:52 nvd
Patch available
CVE Published
Feb 19, 2026 - 15:16 nvd
HIGH 8.1

DescriptionNVD

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
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 2 npm packages depend on jspdf (2 direct, 0 indirect)

Ecosystem-wide dependent count for version 4.2.0.

Executive ViewAI

Why It Matters

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.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.0%
Top 90% exploitable
Prevalence
High
very widely used JavaScript/npm PDF generation library in web apps
Exploit
POC
Public exploit code exists
Data Quality
6 sources
Confidence: High
NVD CVE.org EPSS Vendor GitHub VulDB

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

64
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

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

cpe:2.3:a:parall:jspdf:*:*:*:*:*:node.js:*:*

More in Jspdf

View all
CVE-2026-25535 HIGH POC
8.7 Feb 19

Denial of service in jsPDF (npm package, all versions prior to 4.2.0) lets an attacker who can supply image input to the

CVE-2026-24737 HIGH POC
8.1 Feb 02

PDF generation in jsPDF prior to version 4.1.0 allows injection of arbitrary PDF objects through unsanitized input passe

CVE-2026-24133 MEDIUM POC
6.5 Feb 02

Denial of service in jsPDF prior to version 4.1.0 occurs when malicious BMP files with oversized dimension headers are p

CVE-2020-7691 MEDIUM POC
6.1 Jul 06

In all versions of the package jspdf, it is possible to use <<script>script> in order to go over the filtering regex. Ra

CVE-2020-7690 MEDIUM POC
6.1 Jul 06

All affected versions <2.0.0 of package jspdf are vulnerable to Cross-site Scripting (XSS). Rated medium severity (CVSS

CVE-2026-24043 MEDIUM POC
5.4 Feb 02

Jspdf versions up to 4.1.0 contains a vulnerability that allows attackers to inject arbitrary XML (CVSS 5.4).

CVE-2025-68428 CRITICAL
9.2 Jan 05

Local file inclusion and path traversal in the Node.js builds of jsPDF (dist/jspdf.node.js and dist/jspdf.node.min.js) p

CVE-2026-24040 MEDIUM POC
4.8 Feb 02

jsPDF versions prior to 4.1.0 contain a race condition in the addJS method where a shared module-scoped variable is over

CVE-2026-25940 HIGH
8.1 Feb 19

jsPDF versions prior to 4.2.0 allow attackers to inject arbitrary PDF objects including malicious JavaScript through uns

CVE-2021-23353 HIGH
7.5 Mar 09

This affects the package jspdf before 2.3.1. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable,

CVE-2025-57810 HIGH POC
8.7 Aug 26

jsPDF is a library to generate PDFs in JavaScript. Rated high severity (CVSS 8.7), this vulnerability is remotely exploi

CVE-2025-29907 HIGH POC
8.7 Mar 18

jsPDF is a library to generate PDFs in JavaScript. Rated high severity (CVSS 8.7), this vulnerability is remotely exploi

Vendor StatusVendor

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