Jspdf
CVE-2025-68428
CRITICAL
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path traversal prevention
|
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv4 – Jun 30, 2026
Local file inclusion and path traversal in the Node.js builds of jsPDF (dist/jspdf.node.js and dist/jspdf.node.min.js) prior to version 4.0.0 lets an attacker who controls the path argument passed to loadFile, addImage, html, or addFont read arbitrary files from the host filesystem, with the file contents embedded verbatim into the generated PDF. Applications that forward unsanitized user input into these methods leak secrets such as /etc/passwd, configuration files, or private keys to anyone who can request a PDF. No public exploit identified at time of analysis; EPSS risk is very low (0.02%, 6th percentile) and the issue is not in CISA KEV.
Earlier versions of this analysis (3)
Local file inclusion / path traversal in the Node.js builds of jsPDF (dist/jspdf.node.js and dist/jspdf.node.min.js) before version 4.0.0 lets an attacker who controls the first argument of loadFile (or addImage, html, addFont) read arbitrary files from the host filesystem, with the file contents embedded verbatim into the generated PDF and thus exfiltrated. Only server-side Node deployments that pass unsanitized, user-controlled paths to these methods are affected; browser builds are not. There is no public exploit identified and EPSS is very low (0.02%), but the issue is fixed in jsPDF 4.0.0 and tracked in Red Hat advisories.
Arbitrary local file disclosure in the jsPDF Node.js builds (parallax/jsPDF prior to 4.0.0) lets an attacker supplying unsanitized paths to loadFile (or addImage, html, addFont) read any file readable by the Node process via path traversal, with the stolen contents embedded verbatim in the generated PDF. Only the node distributions (dist/jspdf.node.js and dist/jspdf.node.min.js) are affected; fixed in jsPDF@4.0.0, which restricts filesystem access by default. No public exploit identified at time of analysis, and EPSS is very low at 0.02%, indicating limited observed exploitation interest.
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. [CVSS 7.5 HIGH]
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Know when Jspdf gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N
Network-reachable via the embedding app with no auth or interaction (AV:N/PR:N/UI:N); arbitrary file read crosses jsPDF's scope to the host (S:C, C:H), with no integrity or availability impact.
Primary rating from Vendor (github).
CVSS VectorVendor: github
Lifecycle Timeline
7DescriptionCVE.org
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 jsPDF@4.0.0. 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.
Executive ViewAI
jsPDF Node.js library versions prior to 4.0.0 contain a critical path traversal vulnerability allowing server-side file disclosure when user input reaches PDF generation methods. Organizations deploying jsPDF-based services risk exposure of sensitive configuration files, private keys, and system credentials embedded in generated documents. Immediate patching required to prevent credential compromise and unauthorized system access.
Within 24 hours: Audit all code repositories and dependencies for jsPDF usage prior to version 4.0.0; identify applications with user-influenced PDF generation. Within 7 days: Upgrade jsPDF to version 4.0.0 across all environments (development, staging, production); redeploy affected services. Within 30 days: Review PDF generation logs for exploitation attempts; rotate any exposed credentials identified; implement input validation standards for all file path parameters passed to jsPDF methods (loadFile, addImage, html, addFont).
Apply vendor patch (jsPDF version 4.0.0). Interim mitigation: Implement strict whitelist-based path validation for all file path inputs; restrict jsPDF process permissions to only required directories; temporarily disable user-customizable PDF generation until patch is deployed.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
Affected Products (CPE)CVE.org
PDF object injection in the jsPDF JavaScript library (npm package 'jspdf', versions prior to 4.2.0) lets an attacker who
Denial of service in jsPDF (npm package, all versions prior to 4.2.0) lets an attacker who can supply image input to the
PDF generation in jsPDF prior to version 4.1.0 allows injection of arbitrary PDF objects through unsanitized input passe
Denial of service in jsPDF prior to version 4.1.0 occurs when malicious BMP files with oversized dimension headers are p
In all versions of the package jspdf, it is possible to use <<script>script> in order to go over the filtering regex. Ra
All affected versions <2.0.0 of package jspdf are vulnerable to Cross-site Scripting (XSS). Rated medium severity (CVSS
Jspdf versions up to 4.1.0 contains a vulnerability that allows attackers to inject arbitrary XML (CVSS 5.4).
jsPDF versions prior to 4.1.0 contain a race condition in the addJS method where a shared module-scoped variable is over
jsPDF versions prior to 4.2.0 allow attackers to inject arbitrary PDF objects including malicious JavaScript through uns
This affects the package jspdf before 2.3.1. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable,
jsPDF is a library to generate PDFs in JavaScript. Rated high severity (CVSS 8.7), this vulnerability is remotely exploi
jsPDF is a library to generate PDFs in JavaScript. Rated high severity (CVSS 8.7), this vulnerability is remotely exploi
GHSA-f8cm-6447-x5h2
NVD
CVE.org
EPSS
Exploit-DB