CVE-2026-24737: Jspdf JsPDF Has PDF Injection Vulnerability
HIGHCVE-2026-24737 is a HIGH (CVSS 8.1) jspdf has pdf injection vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Jspdf libraries in the npm ecosystem. The issue involves jspdf has pdf injection in acroformchoicefield that allows arbitrary javascript execution. Remediation is available by upgrading affected packages to version 4.1.0.
CVE-2026-24737 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-24737
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.1.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-24737, 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.1.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-24737 Affected Jspdf Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
jspdf
|
npm |
< 4.1.0
|
4.1.0
|
References
Frequently Asked Questions
What is CVE-2026-24737?
Which Jspdf versions are affected?
What version fixes CVE-2026-24737?
Is jspdf affected?
What is the CVSS score of CVE-2026-24737?
What CWE is associated with CVE-2026-24737?
How can I check npm dependencies for CVE-2026-24737?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pqxr-3g65-p328",
"modified" : "2026-02-03T16:13:01Z",
"published" : "2026-02-02T18:29:49Z",
"aliases" : [ "CVE-2026-24737" ],
"summary" : "jsPDF has PDF Injection in AcroFormChoiceField that allows Arbitrary JavaScript Execution",
"details" : "### Impact\n\nUser control of properties and methods of the Acroform module allows users to inject arbitrary PDF objects, such as JavaScript actions.\n\nIf given the possibility to pass unsanitized input to one of the following methods or properties, a user can inject arbitrary PDF objects, such as JavaScript actions, which are executed when the victim opens the document. The vulnerable API members are:\n\n* `AcroformChoiceField.addOption`\n* `AcroformChoiceField.setOptions`\n* `AcroFormCheckBox.appearanceState`\n* `AcroFormRadioButton.appearanceState`\n\nExample attack vector:\n\n```js\nimport { jsPDF } from \"jspdf\"\nconst doc = new jsPDF();\n\nvar choiceField = new doc.AcroFormChoiceField();\nchoiceField.T = \"VulnerableField\";\nchoiceField.x = 20;\nchoiceField.y = 20;\nchoiceField.width = 100;\nchoiceField.height = 20;\n\n// PAYLOAD:\n// 1. Starts with \"/\" to bypass escaping.\n// 2. \"dummy]\" closes the array.\n// 3. \"/AA\" injects an Additional Action (Focus event).\n// 4. \"/JS\" executes arbitrary JavaScript.\nconst payload = \"/dummy] /AA << /Fo << /S /JavaScript /JS (app.alert('XSS')) >> >> /Garbage [\";\n\nchoiceField.addOption(payload);\ndoc.addField(choiceField);\n\ndoc.save(\"test.pdf\");\n```\n\n### Patches\n\nThe vulnerability has been fixed in jsPDF@4.1.0.\n\n### Workarounds\nSanitize user input before passing it to the vulnerable API members.\n\n### Credits\nResearch and fix: Ahmet Artuç",
"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.1.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 4.0.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/parallax/jsPDF/security/advisories/GHSA-pqxr-3g65-p328"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-24737"
}, {
"type" : "WEB",
"url" : "https://github.com/parallax/jsPDF/commit/da291a5f01b96282545c9391996702cdb8879f79"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/parallax/jsPDF"
}, {
"type" : "WEB",
"url" : "https://github.com/parallax/jsPDF/releases/tag/v4.1.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-116" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-02-02T18:29:49Z",
"nvd_published_at" : "2026-02-02T23:16:08Z"
}
}