CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2025-68428

CVE-2025-68428: Critical Path Traversal and Local File Inclusion in jsPDF

Amit Schendel
Amit Schendel
Senior Security Researcher

Feb 28, 2026·6 min read·104 visits

Executive Summary (TL;DR)

jsPDF versions prior to 4.0.0 contain a Local File Inclusion (LFI) vulnerability in their Node.js builds. The library failed to sanitize file paths in methods like `addImage` and `loadFile`, allowing attackers to read files like `/etc/passwd`. The fix in v4.0.0 introduces a strict allowlist mechanism.

A critical Path Traversal vulnerability in the Node.js build of the jsPDF library allows attackers to read arbitrary files from the server filesystem. By manipulating file paths passed to PDF generation methods, unauthorized actors can embed sensitive server data into generated documents.

Vulnerability Overview

CVE-2025-68428 represents a critical security flaw in the server-side implementation of jsPDF, a widely used library for generating PDF documents. While jsPDF is primarily known for client-side usage in browsers, it offers specific builds (jspdf.node.js and jspdf.node.min.js) for Node.js environments. These server-side builds require file system access to load resources such as fonts, images, and HTML templates.

The vulnerability is classified as a Path Traversal (CWE-22) and Local File Inclusion (LFI) issue. It arises because the library explicitly trusted user-supplied paths when loading external resources. If a web application exposes PDF generation functionality—for instance, allowing users to specify a logo URL or a font path—an attacker can supply a malicious path containing traversal sequences (e.g., ../../).

Successful exploitation results in the application reading files outside the intended directory. The content of these files is then processed and often embedded directly into the generated PDF, allowing the attacker to retrieve sensitive system configuration files, source code, or credentials simply by downloading the resulting document.

Root Cause Analysis

The root cause of this vulnerability lies in the nodeReadFile function located within the libs/fileloading.js module. In versions prior to 4.0.0, this function was responsible for handling file I/O operations when the library detected it was running in a Node.js environment.

The logic used path.resolve(url) to process the input path. While path.resolve resolves relative segments like .., it does not verify that the resulting absolute path resides within a safe or expected directory. It simply normalizes the string and returns an absolute path on the filesystem.

Immediately after resolution, the library passed this absolute path to fs.readFileSync. There were no checks to ensure the path was within a specific sandbox or allowlist. Consequently, an input of ../../../../etc/passwd would be resolved by Node.js to /etc/passwd (assuming the traversal depth was sufficient), and the file system API would obediently read the file. This creates a direct bridge between user input and the server's restricted filesystem.

Code Analysis

The following analysis compares the vulnerable file loading logic with the hardened implementation in version 4.0.0.

Vulnerable Implementation (Pre-v4.0.0)

In the vulnerable version, the code performs no validation on the resolved path. It assumes that path.resolve is sufficient for safety, which is a common misconception.

// libs/fileloading.js (simplified)
function nodeReadFile(url, callback) {
    // DANGEROUS: path.resolve processes '..' but enforces no boundaries
    var resolvedPath = require('path').resolve(url);
    
    // The file is read immediately without authorization checks
    var data = require('fs').readFileSync(resolvedPath);
    return data;
}

Patched Implementation (v4.0.0)

The fix introduces a strict "deny-by-default" model. It requires developers to explicitly allowlist paths via jsPDF.allowFsRead.

// libs/fileloading.js (patched)
function nodeReadFile(url, callback) {
    var path = require('path');
    var fs = require('fs');
    
    // 1. Resolve the path to handle relative segments
    var resolvedPath = path.resolve(url);
    
    // 2. CHECK: Is this path in the allowed list?
    // The library now iterates through `jsPDF.allowFsRead` patterns.
    // If no match is found, it throws an error preventing the read.
    if (!isPathAllowed(resolvedPath)) {
        throw new Error("File access denied: " + resolvedPath);
    }
    
    // 3. SAFE: Read the file only after validation
    return fs.readFileSync(resolvedPath);
}

> [!NOTE] > The patch forces a breaking change. Developers upgrading to v4.0.0 must configure the allowFsRead property, or all local file loading operations will fail by default.

Exploitation Methodology

Exploiting this vulnerability requires an application to pass user-controlled input into one of jsPDF's file-loading methods, such as addImage, addFont, or loadFile. A common scenario is an invoice generator that allows a user to specify a custom logo.

Attack Vector

  1. Reconnaissance: The attacker identifies a feature that generates PDFs and accepts a URL or filename (e.g., POST /api/invoice with {"logo": "default.png"}).
  2. Payload Construction: The attacker crafts a payload using directory traversal sequences to reach the root directory and access sensitive files.
  3. Execution: The payload is submitted: {"logo": "../../../../../../../etc/passwd"}.
  4. Data Exfiltration: The server generates the PDF. Since jsPDF treats the file content as image or font data (or raw text depending on the method), the content of /etc/passwd is embedded into the PDF stream.

Proof of Concept

If the application blindly passes the input to doc.addImage, the resulting PDF might be corrupt (as /etc/passwd is not a valid image), but the file data is still present in the PDF source code. If loadFile is used, the text is returned directly.

# Example of retrieving the generated PDF and inspecting raw content
curl -X POST https://vulnerable-app.com/generate -d "image=../../etc/passwd" -o leak.pdf
 
# Inspecting the PDF binary for known strings
grep "root:x:0:0" leak.pdf

Impact Assessment

The impact of CVE-2025-68428 is rated Critical (CVSS 9.2) due to the complete loss of confidentiality regarding local files on the server.

  • Confidentiality: High. Attackers can read configuration files, environment variables (if stored in files), source code, and system credentials. This can lead to further compromise of the infrastructure or database.
  • Integrity: None. The vulnerability allows reading files, not writing or modifying them.
  • Availability: Low to None. While an attacker might try to read extremely large files to exhaust memory, the primary risk is data leakage.

This vulnerability is particularly dangerous because it bypasses application-level authentication checks for file access, relying solely on the permissions of the Node.js process, which often runs with excessive read privileges.

Remediation & Mitigation

The only complete fix is to upgrade the library and configure the new security controls. Network-level mitigations are difficult to implement effectively because the traversal happens within the application logic, not the HTTP URI (unless the input is taken directly from the URL path).

Official Patch

Upgrade to jsPDF v4.0.0 or later immediately. Verify the version in your package.json:

"dependencies": {
  "jspdf": "^4.0.0"
}

Configuration Required

After upgrading, you must explicitly allow access to the directories your application needs. Faiilure to do so will break PDF generation features that load local files.

const { jsPDF } = require('jspdf');
const doc = new jsPDF();
 
// SECURITY: Whitelist specific directories for file access
doc.allowFsRead = [
  path.resolve(__dirname, 'assets/fonts'),
  path.resolve(__dirname, 'assets/images')
];

Defense in Depth

For critical environments, consider using the Node.js experimental permission model (available in Node 20+) to restrict the filesystem access of the entire process, providing a safety net even if the library is misconfigured.

node --permission --allow-fs-read="/app/assets/*" app.js

Official Patches

ParallaxjsPDF v4.0.0 Release Notes

Fix Analysis (1)

Technical Appendix

CVSS Score
9.2/ 10
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
EPSS Probability
0.02%
Top 94% most exploited

Affected Systems

jsPDF (Node.js build)jsPDF (dist/jspdf.node.js)jsPDF (dist/jspdf.node.min.js)

Affected Versions Detail

Product
Affected Versions
Fixed Version
jsPDF
parallax
< 4.0.04.0.0
AttributeDetail
CWE IDCWE-22
Attack VectorNetwork
CVSS v4.09.2 (Critical)
CVSS v3.17.5 (High)
EPSS Score0.02%
Exploit StatusProof of Concept (PoC)
KEV ListedNo

MITRE ATT&CK Mapping

T1006Direct Volume Access
Defense Evasion
T1553Subvert Trust Controls
Defense Evasion
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Known Exploits & Detection

GitHubDockerized PoC demonstrating LFI in invoice generation
NucleiDetection Template Available

Vulnerability Timeline

Vulnerability patched in commit a688c8f4
2025-12-18
CVE-2025-68428 assigned
2026-01-05
Public PoCs released on GitHub
2026-01-14

References & Sources

  • [1]Initial Issue Report
  • [2]NVD Entry for CVE-2025-68428

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•25 minutes ago•CVE-2026-55620
7.5

CVE-2026-55620: Algorithmic Complexity Denial of Service in GOVCERT-LU eml_parser

Prior to version 3.0.2, GOVCERT-LU's eml_parser library is vulnerable to an algorithmic complexity Denial of Service (DoS) vulnerability via the comment-stripping routine noparenthesis() in routing.py. An unauthenticated attacker can submit a crafted EML file containing nested parenthesized comments to cause complete CPU saturation. This happens due to a quadratic time complexity bottleneck in regex replacement of nested structures.

Amit Schendel
Amit Schendel
0 views•6 min read
•about 1 hour ago•CVE-2026-55629
8.7

CVE-2026-55629: Arbitrary File Read via Path Traversal in Whistle Proxy Internal Service

Whistle prior to version 2.10.3 contains a path traversal vulnerability in its internal service layer. An unauthenticated remote attacker can read arbitrary files on the hosting operating system by issuing a crafted GET request containing relative or absolute file paths to the `/cgi-bin/temp/get` endpoint. This behavior occurs because the application fails open when an input file parameter does not match the temporary file format regex.

Alon Barad
Alon Barad
3 views•6 min read
•about 2 hours ago•CVE-2026-55609
7.1

CVE-2026-55609: Arbitrary File Read and Write via Model Context Protocol (MCP) Tools in sublinear-time-solver and consciousness-explorer

An arbitrary file read and write vulnerability exists in the Model Context Protocol (MCP) server endpoints of sublinear-time-solver and consciousness-explorer. By providing unvalidated file paths to the export_state, import_state, saveVectorToFile, and loadVectorFromFile tools, local attackers can read or overwrite sensitive host files.

Alon Barad
Alon Barad
2 views•5 min read
•about 3 hours ago•CVE-2026-55604
8.6

CVE-2026-55604: Authorization Bypass via Global Session Singleton in @arikusi/deepseek-mcp-server

An Authorization Bypass Through User-Controlled Key (CWE-639 / Insecure Direct Object Reference) vulnerability exists in @arikusi/deepseek-mcp-server starting in version 1.4.2 and fixed in 1.7.0. In Streamable HTTP transport mode, a process-global SessionStore singleton allows any remote client to retrieve or modify active conversation contexts belonging to other clients.

Alon Barad
Alon Barad
6 views•7 min read
•about 4 hours ago•CVE-2026-45018
9.8

CVE-2026-45018: Unauthenticated Remote Code Execution via MCP stdio Transport in Chainlit

CVE-2026-45018 is a critical command injection vulnerability in Chainlit's Model Context Protocol (MCP) stdio transport backend. By submitting a crafted JSON payload containing dangerous argument options to an unauthenticated HTTP endpoint, a remote attacker can bypass executable validation rules and run arbitrary shell commands with the privileges of the active Python process.

Alon Barad
Alon Barad
5 views•10 min read
•about 5 hours ago•CVE-2026-45019
7.2

CVE-2026-45019: Server-Side Request Forgery (SSRF) in Chainlit MCP Endpoint

An unauthenticated server-side request forgery (SSRF) vulnerability exists in Chainlit versions >= 2.4.0rc0 and < 2.12.0 when the Model Context Protocol (MCP) features are enabled. This vulnerability allows remote, unauthenticated attackers to force the backend application server to initiate arbitrary HTTP/HTTPS connections to internal subnets, localhost endpoints, or cloud metadata infrastructure.

Amit Schendel
Amit Schendel
6 views•6 min read