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·101 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

•18 minutes ago•CVE-2026-71308
8.1

CVE-2026-71308: Missing Authorization and Lifecycle Hijacking in Netflix Lemur

Netflix Lemur before 1.9.3 contains a missing authorization vulnerability (CWE-862, CWE-639) when handling certificate creation, upload, or modification. Authenticated non-read-only users can manipulate the replaces parameter to silence expiration notifications and hijack certificate rotation tasks for arbitrary targets, leading to unauthorized TLS certificate deployment and traffic interception.

Alon Barad
Alon Barad
0 views•7 min read
•about 1 hour ago•CVE-2026-71317
6.5

CVE-2026-71317: Missing Authorization in Netflix Lemur Allows Unauthorized Subordinate CA Creation

CVE-2026-71317 is a critical Broken Object-Level Authorization (BOLA) / Missing Authorization vulnerability in Netflix Lemur versions prior to 1.9.3. When the self-service authority creation option is enabled (ADMIN_ONLY_AUTHORITY_CREATION = False), Lemur allows authenticated non-read-only users to request the creation of a subordinate Certificate Authority (sub-CA) chained to any internal parent authority, even if the requesting user lacks administrative or usage permissions over that parent CA. This allows attackers to generate subordinate CAs signed by trusted root certificates, exposing private keys and compromising the organizational PKI trust chain.

Alon Barad
Alon Barad
2 views•7 min read
•about 2 hours ago•CVE-2026-71322
4.3

CVE-2026-71322: Missing Authorization Check in Netflix Lemur Certificate Export

Netflix Lemur, a TLS/SSL certificate management framework, contains a missing authorization check in its certificate export endpoint. Prior to version 1.9.3, the validation logic verifying whether a user had permission to export a certificate was incorrectly placed inside a block that executed only if the selected plugin required a private key. When an authenticated user attempted to export a certificate using a plugin that did not require the private key, the authorization check was bypassed, allowing unauthorized access to the public portions of the certificate and producing misleading audit logs.

Alon Barad
Alon Barad
2 views•6 min read
•about 3 hours ago•GHSA-JF24-8G2H-2WG7
7.2

GHSA-JF24-8G2H-2WG7: Remote Code Execution in LibreNMS AboutController via Binary Path Substitution

A critical security flaw in LibreNMS allows authenticated administrators to execute arbitrary commands by modifying the configured binary path for snmpget and accessing the About page. This occurs due to insufficient verification of the executable file's identity and integrity prior to executing it with shell_exec.

Amit Schendel
Amit Schendel
1 views•6 min read
•about 4 hours ago•GHSA-7CJ5-V4PP-V632
4.8

GHSA-7cj5-v4pp-v632: Stored Cross-Site Scripting in LibreNMS Graph Descriptions

LibreNMS versions prior to 26.7.0 are vulnerable to a stored Cross-Site Scripting (XSS) vulnerability. An authenticated administrator can inject arbitrary HTML or JavaScript into graph descriptions via specific administrative configuration endpoints. When another authenticated user views the affected graph, the unescaped payload executes within their browser context.

Alon Barad
Alon Barad
2 views•5 min read
•about 5 hours ago•GHSA-7GWW-X7FH-JF9J
8.1

GHSA-7GWW-X7FH-JF9J: SSRF-Driven Stored Cross-Site Scripting in LibreNMS Oxidized Integration

An injection vulnerability in LibreNMS's Oxidized integration component allows administrative or network-positioned attackers to achieve stored cross-site scripting (XSS). By setting a malicious oxidized.url endpoint, the server makes outbound queries and processes returned JSON fields containing malicious HTML or JavaScript. These payloads are outputted directly in the web UI without appropriate output encoding.

Amit Schendel
Amit Schendel
2 views•6 min read