Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. jspdf
  4. ›
  5. CVE-2025-68428

CVE-2025-68428: jsPDF has Local File Inclusion/Path Traversal vulnerability

January 5, 2026 (updated January 6, 2026)

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, addFont.

Only the node.js builds of the library are affected, namely the dist/jspdf.node.js and dist/jspdf.node.min.js files.

Example attack vector:

import { jsPDF } from "./dist/jspdf.node.js";

const doc = new jsPDF();

doc.addImage("./secret.txt", "JPEG", 0, 0, 10, 10);
doc.save("test.pdf"); // the generated PDF will contain the "secret.txt" file

References

  • github.com/advisories/GHSA-f8cm-6447-x5h2
  • github.com/parallax/jsPDF
  • github.com/parallax/jsPDF/commit/a688c8f479929b24a6543b1fa2d6364abb03066d
  • github.com/parallax/jsPDF/releases/tag/v4.0.0
  • github.com/parallax/jsPDF/security/advisories/GHSA-f8cm-6447-x5h2
  • nvd.nist.gov/vuln/detail/CVE-2025-68428

Code Behaviors & Features

Detect and mitigate CVE-2025-68428 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 4.0.0

Fixed versions

  • 4.0.0

Solution

Upgrade to version 4.0.0 or above.

Impact 8.6 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-35: Path Traversal: '.../...//'
  • CWE-73: External Control of File Name or Path

Source file

npm/jspdf/CVE-2025-68428.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 04 Feb 2026 00:35:43 +0000.