CVE-2026-24043: Jspdf JsPDF Vulnerable To Stored XMP Vulnerability

MODERATE
Advisory Identifier: GHSA-vm32-vv63-w422
CWE-20 CWE-74
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-24043
GHSA Identifier GHSA-vm32-vv63-w422
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-20: Improper Input Validation
Affected Product Jspdf
Package Ecosystem npm
Published Date
Last Updated

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.

jspdf fixed: 4.1.0
npm install jspdf@4.1.0
Verify Direct and Transitive Dependencies

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

### Impact User control of the first argument of the `addMetadata` function allows users to inject arbitrary XML. If 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. Example attack vector: ```js import { jsPDF } from "jspdf" const doc = new jsPDF() // Input a string that closes the current XML tag and opens a new one. // We are injecting a fake "dc:creator" (Author) to spoof the document source. const maliciousInput = '</jspdf:metadata></rdf:Description>' + '<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/">' + '<dc:creator>TRUSTED_ADMINISTRATOR</dc:creator>' + // <--- Spoofed Identity '</rdf:Description>' + '<rdf:Description><jspdf:metadata>' // The application innocently adds the user's input to the metadata doc.addMetadata(maliciousInput, "http://valid.namespace") doc.save("test.pdf") ``` ### Patches The vulnerability has been fixed in jsPDF@4.1.0 ### Workarounds Sanitize user input before passing it to the `addMetadata` method: escape XML entities. For example: ```js let input = "..." input = input .replace(/&/g, "&amp;") .replace(/</g, "&lt;") .replace(/>/g, "&gt;") .replace(/"/g, "&quot;") .replace(/'/g, "&apos;") doc.addMetadata(input) ```

CVE-2026-24043 Affected Jspdf Versions

1 component(s)
Fixed Versions:
4.1.0
Product / Package Ecosystem Affected Versions Fixed Version
jspdf
npm
< 4.1.0
4.1.0

References

Frequently Asked Questions

What is CVE-2026-24043?
CVE-2026-24043 is a security vulnerability in Jspdf involving jsPDF Vulnerable to Stored XMP Metadata Injection (Spoofing & Integrity Violation) under CWE-20: Improper Input Validation.
Which Jspdf versions are affected?
Affected versions include releases prior to 4.1.0 across affected packages: jspdf.
What version fixes CVE-2026-24043?
Upgrading to 4.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jspdf affected?
Yes, jspdf is affected in releases prior to 4.1.0. Upgrade your dependency to 4.1.0 or later.
What CWE is associated with CVE-2026-24043?
CVE-2026-24043 is classified under CWE-20: Improper Input Validation (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.).
How can I check npm dependencies for CVE-2026-24043?
Run the dependency tree command: 'npm ls jspdf'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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, \"&amp;\")\n    .replace(/</g, \"&lt;\")\n    .replace(/>/g, \"&gt;\")\n    .replace(/\"/g, \"&quot;\")\n    .replace(/'/g, \"&apos;\")\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"
  }
}