CVE-2025-68428: jsPDF has Local File Inclusion/Path Traversal vulnerability
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.
Security readout for executives and security teams
Plain-English summary
A vulnerable server using jsPDF can be tricked into placing local files—potentially secrets, configuration, or application data—inside a generated PDF. The issue is critical when untrusted users can influence file paths. It affects only jsPDF’s Node.js builds before version 4.0.0, not every use of the library.
Executive priority
Treat internet-facing or multi-tenant PDF services as urgent: identify vulnerable Node.js deployments and upgrade promptly. Prioritize systems processing customer-controlled filenames, templates, images, HTML, or fonts because successful abuse could disclose secrets through apparently normal PDF output.
Technical view
In jsPDF before 4.0.0, unsanitized path input reaching loadFile, addImage, html, or addFont can cause local file inclusion and path traversal. The Node.js process reads the selected file and embeds its contents verbatim in the generated PDF. Only dist/jspdf.node.js and dist/jspdf.node.min.js are identified as affected.
Likely exposure
Exposure is highest in server-side PDF-generation services using jsPDF’s Node.js builds below 4.0.0 where remote or otherwise untrusted input influences paths passed to affected methods. Browser-only builds, upgraded deployments, and applications without user-controlled path flow are not identified as vulnerable by the supplied sources.
Exploitation context
The supplied bundle reports network-reachable, low-complexity exploitation without privileges or user interaction, with high confidentiality impact. It does not provide evidence of active exploitation, and the KEV indicator is false. Practical exploitability still depends on untrusted path input reaching an affected method and the Node.js process having access to valuable files.
Researcher notes
The advisory maps the flaw to CWE-35 and CWE-73 and assigns CVSS 4.0 score 9.2. Scope is explicitly limited to Node.js distribution builds. The bundle names no public exploit or observed campaign. Review data flow and process filesystem permissions; package presence alone does not establish reachability.
Mitigation direction
Upgrade jsPDF to version 4.0.0 or later.
Prevent untrusted paths from reaching loadFile, addImage, html, or addFont.
On supported Node.js versions, use the production permission controls recommended by jsPDF.
For older Node.js versions, strictly sanitize and allowlist user-provided paths.
Validation and detection
Inventory jsPDF versions used by production and build-time dependencies.
Confirm whether applications load either identified Node.js distribution file.
Trace untrusted inputs into loadFile, addImage, html, and addFont.
Verify version 4.0.0 rejects unauthorized filesystem access by default.
Retest legitimate PDF, image, HTML, and font workflows after remediation.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · medium confidence lookup
CWE-35: File access and web shell behavior lookup
File traversal and upload weaknesses can lead teams to review file, web shell, execution, and collection telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
File traversal and upload weaknesses can lead teams to review file, web shell, execution, and collection telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references file access or upload behavior, so file telemetry and web shell review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-35 · source CWE mapping
Path Traversal: '.../...//'
Path Traversal: '.../...//' represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
External Control of File Name or Path represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.