CVE-2020-7680 Cross-site Scripting in docsify
An attacker can inject arbitrary JavaScript into docsify pages by manipulating fragment identifiers, potentially compromising user sessions.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2020-7680?
CVE-2020-7680 is a medium-severity cross-site scripting vulnerability in docsify, published on 20 Jul 2020. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
docsify prior to 4.11.4 is susceptible to Cross-site Scripting (XSS). Docsify.js uses fragment identifiers (parameters after # sign) to load resources from server-side .md files. Due to lack of validation here, it is possible to provide external URLs after the /#/ (domain.com/#//attacker.com) and render arbitrary JavaScript/HTML inside docsify page.
Weakness: CWE-79
Which versions are affected by CVE-2020-7680?
2 open source packages ship an affected version, including docsify. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
docsify npm | All versions | 4.11.4 |
docsify npm | All versions | 4.11.4 |
Products include Docsifyjs Docsify.
How do I fix CVE-2020-7680?
Upgrade docsify to 4.11.4 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2020-7680 being exploited?
There is no known exploitation of CVE-2020-7680 in the wild and no public exploit code.
Public exploit code: 1 Exploit-DB entry.
Other vulnerabilities in docsify
Sources
Also known as GHSA-qpqh-46qj-vwcw, SNYK-JS-DOCSIFY-567099.