CVE-2026-25755: Jspdf JsPDF Has A PDF Object Vulnerability
HIGHCVE-2026-25755 is a HIGH (CVSS 8.1) jspdf has a pdf object vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Jspdf libraries in the npm ecosystem. The issue involves jspdf has a pdf object injection via unsanitized input in addjs method. Remediation is available by upgrading affected packages to version 4.2.0.
CVE-2026-25755 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N).
How to Fix CVE-2026-25755
To remediate this vulnerability, upgrade all affected Jspdf dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install jspdf@4.2.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls jspdf
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-25755, inspect your project dependencies using npm:
npm ls jspdf
Analyze the terminal output to locate any version of Jspdf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.2.0), your application is affected.
Note: The npm ls jspdf command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In Jspdf, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-25755 Affected Jspdf Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
jspdf
|
npm |
< 4.2.0
|
4.2.0
|
References
Frequently Asked Questions
What is CVE-2026-25755?
Which Jspdf versions are affected?
What version fixes CVE-2026-25755?
Is jspdf affected?
What is the CVSS score of CVE-2026-25755?
What CWE is associated with CVE-2026-25755?
How can I check npm dependencies for CVE-2026-25755?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9vjf-qc39-jprp",
"modified" : "2026-03-19T20:49:36Z",
"published" : "2026-02-19T19:32:36Z",
"aliases" : [ "CVE-2026-25755" ],
"summary" : "jsPDF has a PDF Object Injection via Unsanitized Input in addJS Method",
"details" : "### Impact\n\nUser 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.\n\n```js\nimport { jsPDF } from \"jspdf\";\nconst doc = new jsPDF();\n// Payload:\n// 1. ) closes the JS string.\n// 2. > closes the current dictionary.\n// 3. /AA ... injects an \"Additional Action\" that executes on focus/open.\nconst maliciousPayload = \"console.log('test');) >> /AA << /O << /S /JavaScript /JS (app.alert('Hacked!')) >> >>\";\n\ndoc.addJS(maliciousPayload);\ndoc.save(\"vulnerable.pdf\");\n```\n\n### Patches\nThe vulnerability has been fixed in jspdf@4.2.0.\n\n### Workarounds\nEscape parentheses in user-provided JavaScript code before passing them to the `addJS` method.\n### References\nhttps://github.com/ZeroXJacks/CVEs/blob/main/2026/CVE-2026-25755.md",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "jspdf"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.2.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/parallax/jsPDF/security/advisories/GHSA-9vjf-qc39-jprp"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-25755"
}, {
"type" : "WEB",
"url" : "https://github.com/parallax/jsPDF/commit/56b46d45b052346f5995b005a34af5dcdddd5437"
}, {
"type" : "WEB",
"url" : "https://github.com/ZeroXJacks/CVEs/blob/main/2026/CVE-2026-25755.md"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/parallax/jsPDF"
}, {
"type" : "WEB",
"url" : "https://github.com/parallax/jsPDF/releases/tag/v4.2.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-116", "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-02-19T19:32:36Z",
"nvd_published_at" : "2026-02-19T15:16:12Z"
}
}