CVE-2020-7690
Description
All affected versions <2.0.0 of package jspdf are vulnerable to Cross-site Scripting (XSS). It is possible to inject JavaScript code via the html method.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
CVE-2020-7690 is a DOM-based XSS vulnerability in jsPDF <2.0.0, allowing arbitrary JavaScript injection via the `html()` method.
Root
Cause
CVE-2020-7690 is a cross-site scripting (XSS) vulnerability affecting the jsPDF library in versions prior to 2.0.0 [1]. The flaw resides in the html() method, which does not sanitize user-provided HTML. An attacker can embed arbitrary JavaScript that executes in the context of the document being generated [1][2].
Exploitation
An attacker can craft an HTML payload containing malicious event handlers (e.g., onerror or onload attributes) and pass it to the html() method [1][3]. No authentication is required; the attack vector is entirely client-side. The proof-of-concept provided by Snyk demonstrates injecting an `` tag that executes a JavaScript payload when the image fails to load [1][4]. Applications that render untrusted HTML using jsPDF without prior sanitization are vulnerable.
Impact
Successful exploitation allows an attacker to execute arbitrary JavaScript in the browser session of the user viewing the generated PDF content [1][2]. This can lead to data exfiltration, session hijacking, or other actions permitted by the same-origin policy of the application that embeds jsPDF.
Mitigation
The vulnerability is fixed in jsPDF version 2.0.0 and later [1]. Users of the Bower or WebJars distribution channels should upgrade to version 2.3.1 or higher [3][4]. If upgrading is not immediately possible, all user-supplied HTML should be sanitized before being passed to the html() method.
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
jspdfnpm | < 2.0.0 | 2.0.0 |
Affected products
2- jspdf/jspdfdescription
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
11- github.com/advisories/GHSA-vh59-v9r5-4mh4ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2020-7690ghsaADVISORY
- github.com/MrRio/jsPDF/issues/2795ghsax_refsource_MISCWEB
- github.com/parallax/jsPDF/issues/2862ghsaWEB
- github.com/parallax/jsPDF/issues/2971ghsaWEB
- github.com/parallax/jsPDF/pull/2806ghsaWEB
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARS-575260ghsaWEB
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWER-575258ghsaWEB
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWERGITHUBMRRIO-575259ghsaWEB
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-575257ghsaWEB
- snyk.io/vuln/SNYK-JS-JSPDF-575256ghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.