Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-25755: CWE-94: Improper Control of Generation of Code ('Code Injection') in parallax jsPDF

0
High
VulnerabilityCVE-2026-25755cvecve-2026-25755cwe-94cwe-116
Published: Thu Feb 19 2026 (02/19/2026, 14:41:46 UTC)
Source: CVE Database V5
Vendor/Project: parallax
Product: jsPDF

Description

jsPDF is a library to generate PDFs in JavaScript. Prior to 4.2.0, user control of the argument of the `addJS` method allows an attacker to inject arbitrary PDF objects into the generated document. By crafting a payload that escapes the JavaScript string delimiter, an attacker can execute malicious actions or alter the document structure, impacting any user who opens the generated PDF. The vulnerability has been fixed in jspdf@4.2.0. As a workaround, escape parentheses in user-provided JavaScript code before passing them to the `addJS` method.

AI-Powered Analysis

AILast updated: 02/19/2026, 15:04:13 UTC

Technical Analysis

The vulnerability identified as CVE-2026-25755 affects the parallax jsPDF library, a widely used JavaScript tool for generating PDF documents client-side or server-side. Prior to version 4.2.0, the addJS method accepts user-controlled input that is embedded as JavaScript within the PDF. Due to insufficient sanitization and improper handling of string delimiters, an attacker can craft a payload that escapes the intended JavaScript string context, enabling injection of arbitrary PDF objects or JavaScript code. This code injection can alter the document structure or execute malicious scripts when the PDF is opened by an end user. The root cause is classified under CWE-94 (Improper Control of Generation of Code) and CWE-116 (Improper Encoding or Escaping of Output). The vulnerability is remotely exploitable without authentication but requires the victim to open the malicious PDF, thus involving user interaction. The CVSS v3.1 score of 8.1 reflects high impact on confidentiality and integrity, with network attack vector and low attack complexity. The vulnerability has been addressed in jsPDF 4.2.0 by properly sanitizing inputs to addJS. As a temporary mitigation, escaping parentheses in user-supplied JavaScript code before passing it to addJS can reduce risk. No public exploit code or active exploitation has been reported to date.

Potential Impact

This vulnerability poses a significant risk to organizations that generate PDFs dynamically using vulnerable versions of jsPDF, especially when incorporating untrusted or user-supplied input into the addJS method. Successful exploitation can lead to arbitrary code execution within the PDF context, potentially allowing attackers to execute malicious scripts, steal sensitive information, or manipulate document content. This compromises confidentiality and integrity of the PDF data. Since PDFs are widely used for document exchange in enterprises, government, and financial sectors, the threat surface is broad. Attackers could use social engineering to distribute malicious PDFs via email or websites, targeting end users to trigger the payload. Although availability is not impacted, the breach of confidentiality and integrity can lead to data leaks, fraud, or reputational damage. The lack of known exploits in the wild reduces immediate risk but does not eliminate the threat, especially as attackers may develop exploits following public disclosure. Organizations relying on jsPDF for document generation should consider this vulnerability critical and address it promptly to avoid potential compromise.

Mitigation Recommendations

Organizations should immediately upgrade all instances of jsPDF to version 4.2.0 or later, where the vulnerability is fully patched. For environments where immediate upgrade is not feasible, implement strict input validation and sanitization on all user-supplied data passed to the addJS method. Specifically, escape parentheses and other special characters in JavaScript code before embedding it in PDFs to prevent delimiter escape sequences. Additionally, restrict the use of addJS to trusted inputs only and avoid incorporating untrusted or external data without thorough validation. Employ PDF security best practices such as disabling JavaScript execution in PDF viewers where possible, or using viewer settings that prompt users before executing embedded scripts. Monitor for suspicious PDF files in email gateways and endpoint security solutions to detect potential exploitation attempts. Educate users about the risks of opening PDFs from untrusted sources. Finally, maintain an inventory of applications and services using jsPDF to ensure all vulnerable versions are identified and remediated.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-02-05T18:35:52.357Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6997264f5215391843713250

Added to database: 2/19/2026, 3:03:43 PM

Last enriched: 2/19/2026, 3:04:13 PM

Last updated: 2/21/2026, 12:16:15 AM

Views: 178

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats