CVE-2026-24043: Jspdf JsPDF Vulnerable To Stored XMP Vulnerability
MODERATECVE-2026-24043 is a MODERATE jspdf vulnerable to stored xmp vulnerability (CWE-20: Improper Input Validation) affecting Jspdf libraries in the npm ecosystem. The issue involves jspdf vulnerable to stored xmp metadata injection (spoofing & integrity violation). Remediation is available by upgrading affected packages to version 4.1.0.
CVE-2026-24043 at a Glance
How to Fix CVE-2026-24043
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-24043, 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. 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-24043 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-24043?
Which Jspdf versions are affected?
What version fixes CVE-2026-24043?
Is jspdf affected?
What CWE is associated with CVE-2026-24043?
How can I check npm dependencies for CVE-2026-24043?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vm32-vv63-w422",
"modified" : "2026-02-03T16:12:30Z",
"published" : "2026-02-02T18:28:29Z",
"aliases" : [ "CVE-2026-24043" ],
"summary" : "jsPDF Vulnerable to Stored XMP Metadata Injection (Spoofing & Integrity Violation)",
"details" : "### Impact\n\nUser control of the first argument of the `addMetadata` function allows users to inject arbitrary XML.\n\nIf given the possibility to pass unsanitized input to the `addMetadata` method, a user can inject arbitrary XMP metadata into the generated PDF. If the generated PDF is signed, stored or otherwise processed after, the integrity of the PDF can no longer be guaranteed.\n\nExample attack vector:\n\n```js\nimport { jsPDF } from \"jspdf\"\n\nconst doc = new jsPDF()\n\n// Input a string that closes the current XML tag and opens a new one.\n// We are injecting a fake \"dc:creator\" (Author) to spoof the document source.\nconst maliciousInput = '</jspdf:metadata></rdf:Description>' +\n '<rdf:Description xmlns:dc=\"http://purl.org/dc/elements/1.1/\">' +\n '<dc:creator>TRUSTED_ADMINISTRATOR</dc:creator>' + // <--- Spoofed Identity\n '</rdf:Description>' +\n '<rdf:Description><jspdf:metadata>'\n\n// The application innocently adds the user's input to the metadata\ndoc.addMetadata(maliciousInput, \"http://valid.namespace\")\n\ndoc.save(\"test.pdf\")\n```\n\n### Patches\n\nThe vulnerability has been fixed in jsPDF@4.1.0\n\n### Workarounds\n\nSanitize user input before passing it to the `addMetadata` method: escape XML entities. For example:\n\n```js\nlet input = \"...\"\n\ninput = input\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\")\n\ndoc.addMetadata(input)\n```",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA: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-vm32-vv63-w422"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-24043"
}, {
"type" : "WEB",
"url" : "https://github.com/parallax/jsPDF/commit/efe54bf50f3f5e5416b2495e3c24624fc80b6cff"
}, {
"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-20", "CWE-74" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-02-02T18:28:29Z",
"nvd_published_at" : "2026-02-02T23:16:07Z"
}
}