• News/
  • https://www.bleepingcomputer.com/news/security/critical-jspdf-flaw-lets-hackers-steal-secrets-via-generated-pdfs/

Critical jsPDF flaw lets hackers steal secrets via generated PDFs

BleepingComputer
·
Bill Toulas
·
Published Jan 7, 2026
·
Updated

The jsPDF library for generating PDF documents in JavaScript applications is vulnerable to a critical vulnerability that allows an attacker to steal sensitive data from the local filesystem by including it in generated files. The flaw is a local file inclusion and path traversal that allows passing unsanitized paths to the file loading mechanism (loadFile) in jsPDF versions before 4.0. It is tracked as CVE-2025-68428 and received a severity score of 9.2. The jsPDF library is a widely adopted package with more than 3.5 million weekly downloads in the npm registry. In jsPDF’s Node.js builds, the 'loadFile' function is used for reading the local filesystem. The problem arises when user-controlled input is passed as the file path,  causing jsPDF to incorporate into the generated PDF output the content of the file. Other file loading methods are also affected, including 'addImage', 'html', and 'addFont', as all can call the loadFile function. According to the jsPDF security bulletin, the issue only affects the Node.js builds of the library, namely the dist/jspdf.node.js and dist/jspdf.node.min.js files. In a detailed technical report, application security company Endor Labs says that the exploitation risk is low or nonexistent if file paths are hardcoded, come from a trusted configuration, or strict allowlists are used for inputs. CVE-2025-68428 was fixed in version 4.0.0 of jsPDF by restricting filesystem access by default and relying instead on Node.js permission mode. However,...

Read full article

Affected Software

2 affected components
jsPDF jsPDF<4.0
jsPDF jsPDF>=22.13.0, >=23.5.0, >=24.0.0
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 main topic of this article?

The article discusses a critical vulnerability in the jsPDF library that allows hackers to steal sensitive data via generated PDF documents.

2

What security implications are discussed in the article?

The vulnerability enables attackers to access and steal sensitive data from the local filesystem when PDFs are generated using jsPDF.

3

What products or software are affected by this vulnerability?

The affected product is the jsPDF library, specifically versions from 22.13.0 up to but not including 4.0.

4

How can users protect themselves from this vulnerability?

Users are advised to update to the latest version of jsPDF and apply any security patches provided by the developers.

5

Who is the vendor of the affected software?

The vendor of the affected software is jsPDF.

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