CVE-2026-25940: jsPDF Arbitrary JavaScript Execution via PDF Injection in AcroForm Module

jspdf Updated 19 Feb 2026

Summary

19/02/2026
Yes i
High
8.1

CVE-2026-25940: Impact User control of properties and methods of the Acroform module allows users to inject arbitrary PDF objects, such as JavaScript actions. Affects jspdf versions < 4.2.0. Fixed in 4.2.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

jsPDF is a popular JavaScript library used for generating PDF documents in web applications. It allows developers to create complex PDF files directly from client-side code, offering features such as text, images, and vector graphics. However, a vulnerability in its AcroForm module has been identified, which permits users to inject arbitrary JavaScript into PDF documents, potentially leading to security risks.

Vulnerability Detail

The vulnerability arises from user control over properties and methods of the Acroform module, specifically through the 'appearanceState' property of radio button options. Unsanitized input can be used to inject arbitrary PDF objects, including JavaScript actions that execute when a victim interacts with the PDF. This could lead to malicious actions being performed without the user's consent, such as data theft or unauthorized access.

How To Fix

Minimum fixed version

4.2.0

This is the first release that contains the fix.

npm install jspdf@4.2.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary measure, sanitize any user input before passing it to the vulnerable API members. For example, you can implement a function to remove or escape potentially harmful characters from the input string before assigning it to 'appearanceState'.

Conclusion

The jsPDF library has a significant vulnerability (CVE-2026-25940) that allows for arbitrary JavaScript execution through PDF injection. It is crucial for developers using this library to update to version 4.2.0 or later to protect their applications from potential security threats. Additionally, implementing input sanitization can serve as a temporary workaround until the update is applied.

See every vulnerability recorded for jspdf →

Share this vulnerability

FAQ

jsPDF is a JavaScript library that allows developers to generate PDF documents directly in web applications.

This vulnerability allows for arbitrary JavaScript execution through PDF injection in the AcroForm module of jsPDF.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The CVSS score for this vulnerability is 8.1, indicating a high severity level.

If an immediate update is not possible, ensure to sanitize user inputs before they are passed to the vulnerable API members to mitigate risks.

Related vulnerabilities

Recent vulnerabilities recorded for jspdf.

How To Fix

Minimum fixed version

4.2.0

This is the first release that contains the fix.

npm install jspdf@4.2.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback