jsPDF is a library to generate PDFs in JavaScript. Prior to version 4.2.1, user control of the options argument of the output function allows attackers to inject arbitrary HTML (such as scripts) into the browser context the created PDF is opened in. The vulnerability can be exploited in the following scenario: the attacker provides values for the output options, for example via a web interface. These values are then passed unsanitized (automatically or semi-automatically) to the attack victim. The victim creates and opens a PDF with the attack vector using one of the vulnerable method overloads inside their browser. The attacker can thus inject scripts that run in the victims browser context and can extract or modify secrets from this context. The vulnerability has been fixed in [email protected]. As a workaround, sanitize user input before passing it to the output method.
CVE-2026-31938
This medium-severity CVE scores 6.1 under NVD CVSS v3. EPSS exploit-prediction score not yet available (the EPSS model rescores nightly; freshly-published CVEs typically appear within 48 hours). GitHub Security Advisory data not yet ingested — confidence will rise once GHSA publishes (typical lag: hours to days for open-source ecosystem CVEs; never for infrastructure-only CVEs).
- Lower severity and no public exploit yet
A fix is available — apply it.
- CVSS v3
- 6.1
- EG Score
- 6.1(low)
- EPSS
- 17.8%
- KEV
- Not listed
Published
March 18, 2026
Last Modified
June 30, 2026
References (8)
- security-advisories@githubhttps://github.com/parallax/jsPDF/commit/87a40bbd07e6b30575196370670b41f264aa78d7
- security-advisories@githubhttps://github.com/parallax/jsPDF/releases/tag/v4.2.1
- security-advisories@githubhttps://github.com/parallax/jsPDF/security/advisories/GHSA-wfv2-pwc8-crg5
- 0b0ca135-0b70-47e7-9f44-1890c2a1c46chttps://access.redhat.com/errata/RHSA-2026:7110
- 0b0ca135-0b70-47e7-9f44-1890c2a1c46chttps://access.redhat.com/errata/RHSA-2026:7128
- 0b0ca135-0b70-47e7-9f44-1890c2a1c46chttps://access.redhat.com/security/cve/CVE-2026-31938
- 0b0ca135-0b70-47e7-9f44-1890c2a1c46chttps://bugzilla.redhat.com/show_bug.cgi?id=2448550
- 0b0ca135-0b70-47e7-9f44-1890c2a1c46chttps://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31938.json
Vendor Advisories for CVE-2026-31938(2)
These vendors published their own advisory mentioning this CVE — often with vendor-specific remediation steps + affected product lists not in NVD.
Patch Availability(2)
| Vendor / Ecosystem | Fixed in / Patch | Released | Source |
|---|---|---|---|
| redhat | advanced-cluster-security/rhacs-main-rhel8:1775594119 | 2026-04-08 | redhat |
| redhat | advanced-cluster-security/rhacs-main-rhel8:1775594284 | 2026-04-08 | redhat |
Patches are aggregated from vendor advisories (Red Hat, Microsoft, Cisco, GitHub) and package ecosystems (OSV, GHSA). Multiple rows for the same upstream release have been deduplicated.
Affected Packages
(1 across 1 ecosystem)
npm(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| jspdf | — | 4.2.1 | — |
Weakness Classification(1)
MITRE Common Weakness Enumeration — the root-cause categories this CVE belongs to.
Data Freshness Timeline
(refreshed 9× in last 7d / 12× in last 30d)
Each row is a source pipeline that fetched or updated this CVE on that date, with what changed. For example, "NVD update" means NVD published or revised its analysis for this CVE; "MITRE cvelistV5" means we ingested or refreshed it from the CNA feed. Most recent first.
- 2026-07-07 13:46 UTCEPSS rescore
- 2026-07-06 16:27 UTCEPSS rescore
- 2026-07-06 16:27 UTCEPSS rescore
- 2026-07-06 02:23 UTCEPSS rescore
- 2026-07-06 02:23 UTCEPSS rescore
- 2026-07-05 02:30 UTCEPSS rescore
- 2026-07-04 06:31 UTCEPSS rescore
- 2026-07-01 15:06 UTCEPSS rescore
- 2026-06-30 23:22 UTCEPSS rescore
- 2026-06-30 04:38 UTCEG score recompute
- 2026-06-30 04:38 UTCVendor advisory
- 2026-06-30 04:31 UTCNVD updatefirst tracked
Related CVEs(same vendor + same CWE)
Same vendor
10 shownredhat
Frequently asked(5)
What is CVE-2026-31938?
When was CVE-2026-31938 disclosed?
Is CVE-2026-31938 actively exploited?
What is the CVSS score of CVE-2026-31938?
How do I remediate CVE-2026-31938?
Dependency Blast Radius
See which npm, PyPI, Go, and Maven packages are affected by CVE-2026-31938
Is Your Infrastructure Affected by CVE-2026-31938?
EchelonGraph automatically scans your cloud infrastructure and maps CVE exposure using blast radius analysis.