CVE Catalog

CVE-2025-68428

HighCVSS 7.5
Published: Updated: Translated: NVD NIST

Exploitation Probability (EPSS)

High risk
2.10%

80th percentile - higher than 80% of all known CVEs

Summary

The jsPDF library prior to version 4.0.0 is vulnerable to local file inclusion and path traversal. An attacker can exploit the loadFile method, as well as addImage, html, and addFont, to read arbitrary files from the server's file system. The file contents are then embedded in generated PDF documents.

Risk Assessment

The risk involves potential leakage of sensitive data, such as configuration files, passwords, or customer data, which can be read and embedded in PDFs. An attacker can gain unauthorized access to confidential information.

Recommendation

Immediately update the jsPDF library to version 4.0.0 or later. If an update is not possible, use the --permission flag in Node.js (from version 20.0.0) or thoroughly sanitize all paths passed to the library methods.

Other vulnerabilities in jsPDF

See all
Original NVD description (English source)

jsPDF is a library to generate PDFs in JavaScript. Prior to version 4.0.0, user control of the first argument of the loadFile method in the node.js build allows local file inclusion/path traversal. If given the possibility to pass unsanitized paths to the loadFile method, a user can retrieve file contents of arbitrary files in the local file system the node process is running in. The file contents are included verbatim in the generated PDFs. Other affected methods are `addImage`, `html`, and `addFont`. Only the node.js builds of the library are affected, namely the `dist/jspdf.node.js` and `dist/jspdf.node.min.js` files. The vulnerability has been fixed in [email protected]. This version restricts file system access per default. This semver-major update does not introduce other breaking changes. Some workarounds areavailable. With recent node versions, jsPDF recommends using the `--permission` flag in production. The feature was introduced experimentally in v20.0.0 and is stable since v22.13.0/v23.5.0/v24.0.0. For older node versions, sanitize user-provided paths before passing them to jsPDF.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS