CVE-2026-31938
A flaw in the jsPDF library lets attackers inject malicious scripts into PDFs that run in the victim’s browser when the PDF is opened. The issue exists in versions before 4.2.1 and can be fixed by updating the library. The vulnerability is not yet publicly exploited.
An official fix is available, so this entry is kept for 30 days and then removed automatically.
Who is affected
Web developers using jsPDF to generate PDFs in browsers, specifically any version earlier than 4.2.1.
Real-world impact
An attacker can run arbitrary code in the victim’s browser, potentially stealing or altering sensitive information such as cookies, session tokens, or other secrets.
Why this severity
The CVSS score of 9.6 reflects that the flaw can be triggered over the network with low effort, requires no special privileges, and changes the security scope. It grants attackers high confidentiality and integrity impact while only slightly affecting availability.
What to do about it
- 01Upgrade jsPDF to version 4.2.1 or later.
NVD-referenced vendor advisory
Timeline
- Mar 18, 2026 · Mar 18, 2026PublishedDisclosed and added to the National Vulnerability Database.
- Jul 20, 2026 · 16d agoAdvisory updatedThe NVD record was last revised.
- Jul 20, 2026 · 16d agoOfficial fix availableA vendor patch or mitigation now exists — see the remediation steps above.
How it’s attacked
References & advisories
- github.com/parallax/jsPDF/commit/87a40…patch
- github.com/parallax/jsPDF/releases/tag…productrelease notes
- github.com/parallax/jsPDF/security/adv…mitigationvendor advisory
- access.redhat.com/errata/RHSA-2026:7110
- access.redhat.com/errata/RHSA-2026:7128
- access.redhat.com/security/cve/CVE-2026-31938
- bugzilla.redhat.com/show_bug.cgi
- security.access.redhat.com/data/csaf/v2/vex/2026/cve-2…