CVE-2020-7690: jsPDF cross-site scripting in html method

CVE-2020-7690 · Severity: low · CVSS 3.1 · Published 2021-05-17

jsPDF is a popular JavaScript library used to generate PDF documents in web applications. A cross-site scripting (XSS) vulnerability in the html method allows an attacker to inject malicious JavaScript code that executes in the victim's browser, potentially leading to session hijacking, credential theft, or malware distribution.

Technologies: jspdf (npm). Vendors: npm.

Quick answers

Is CVE-2020-7690 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2020-7690 being exploited in the wild.
How severe is CVE-2020-7690?
Low severity, with a CVSS score of 3.1, published 17 May 2021.
Which products and versions are affected?
jspdf (npm) SEMVER:introduced=0,fixed=2.0.0.
Is there a fix for CVE-2020-7690?
Yes. jspdf (npm): upgrade to 2.0.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2020-7690 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2020-7690?
Check whether you run jspdf (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • jspdf (npm): upgrade to 2.0.0 or later
    npm install jspdf@2.0.0

Technical details

The vulnerability is a cross-site scripting (CWE-79) flaw in the html method of jsPDF, which fails to properly sanitize or escape user-supplied input before rendering it in the PDF. An attacker can inject arbitrary JavaScript code via the html method parameter. The attack requires user interaction (the user must process the malicious PDF or trigger the vulnerable code path) and network access to deliver the payload. Affected versions prior to 2.0.0 are vulnerable; the issue has been fixed in version 2.0.0 and later.

Affected products

  • jsPDF jsPDF < 2.0.0

Identifiers

  • CVE-2020-7690
  • GHSA-vh59-v9r5-4mh4

Timeline

  • 2020-07-06: disclosed
  • 2020: patched: Fixed in version 2.0.0
  • 2021-05-17: advisory

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.