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

Published Feb 2, 2026
·
Updated

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>TRUSTEDADMINISTRATOR</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)

Other sources

jsPDF is a library to generate PDFs in JavaScript. Prior to 4.1.0, 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. The vulnerability has been fixed in jsPDF@4.1.0.

MITRE

Affected Software

2 affected componentsFixes available
npm/jspdf<=4.0.0
4.1.0
parall jspdf Node.js<4.1.0

Event History

Feb 2, 2026
Advisory Published
via GitHub·06:28 PM
Data Sourced
via GitHub·06:28 PM
DescriptionWeaknessAffected Software
CVE Published
via MITRE·08:34 PM
Data Sourced
via MITRE·08:34 PM
DescriptionWeakness
Data Sourced
via NVD·11:16 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:16 PM
RemedyAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-24043?

CVE-2026-24043 is classified as a critical vulnerability due to its potential for stored XMP metadata injection leading to spoofing and integrity violation.

2

How do I fix CVE-2026-24043?

To fix CVE-2026-24043, upgrade to jsPDF version 4.1.0 or later.

3

What is the impact of CVE-2026-24043?

The impact of CVE-2026-24043 allows users to inject arbitrary XML through the `addMetadata` function, compromising data integrity.

4

Which versions of jsPDF are affected by CVE-2026-24043?

CVE-2026-24043 affects all versions of jsPDF up to and including version 4.0.0.

5

How can attackers exploit CVE-2026-24043?

Attackers can exploit CVE-2026-24043 by passing unsanitized input to the `addMetadata` method, enabling injection of malicious XML.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203