CVE-2026-25940 is a high-severity (CVSS 8.1) CWE-116 vulnerability in jspdf. A fix is available for jspdf — see the affected versions and patch details below.
jsPDF's PDF Injection in AcroForm module allows Arbitrary JavaScript Execution (RadioButton.createOption and "AS" property)
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-25940.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
jspdfnpmDescription
Impact
User control of properties and methods of the Acroform module allows users to inject arbitrary PDF objects, such as JavaScript actions.
If given the possibility to pass unsanitized input to the following property, a user can inject arbitrary PDF objects, such as JavaScript actions, which are executed when the victim hovers over the radio option.
AcroformChildClass.appearanceState
Example attack vector:
import { jsPDF } from "jspdf"
const doc = new jsPDF();
const group = new doc.AcroFormRadioButton();
group.x = 10; group.y = 10; group.width = 20; group.height = 10;
doc.addField(group);
const child = group.createOption("opt1");
child.x = 10; child.y = 10; child.width = 20; child.height = 10;
child.appearanceState = "Off /AA << /E << /S /JavaScript /JS (app.alert('XSS')) >> >>";
doc.save("test.pdf");
Patches
The vulnerability has been fixed in [email protected].
Workarounds
Sanitize user input before passing it to the vulnerable API members.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | jspdf | all versions | 4.2.0npm install jspdf@4.2.0 |
Affected Products
jspdfparallDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for jspdf, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update jspdf to 4.2.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-25940 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
To exploit this flaw, an attacker must be able to supply a specially crafted input to the AcroformChildClass.appearanceState property of the Acroform module and convince a user to open the generated PDF document, resulting in arbitrary JavaScript execution when the user interacts with radio buttons. Due to these…
To mitigate this vulnerability, sanitize the user-provided input before passing it to the AcroformChildClass.appearanceState property or other API members. Additionally, do not open PDF documents from untrusted sources.Source: Red Hat security advisory for CVE-2026-25940 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Advanced Cluster Security 4.8 | advanced-cluster-security/rhacs-main-rhel8:1775594119 | RHSA-2026:7110 |
| Red Hat Advanced Cluster Security 4.9 | advanced-cluster-security/rhacs-main-rhel8:1775594284 | RHSA-2026:7128 |
Frequently Asked Questions
Is CVE-2026-25940 in your dependencies?
Find it across npm, including transitive dependencies.