CVE-2021-30074 Docsify vulnerable to cross-site scripting due to mishandled encoding
Attackers can execute arbitrary scripts via XSS in the docsify search component due to improper encoding of code blocks.
- 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-2021-30074?
CVE-2021-30074 is a medium-severity cross-site scripting vulnerability in n/a, published on 2 Apr 2021. 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 4.12.1 is affected by Cross Site Scripting (XSS) because the search component does not appropriately encode Code Blocks and mishandles the " character.
Weakness: CWE-79
Which versions are affected by CVE-2021-30074?
2 open source packages ship an affected version, including docsify. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
docsify npm | All versions | 4.12.2 |
docsify npm | All versions | 4.12.2 |
Products include Docsifyjs Docsify.
How do I fix CVE-2021-30074?
Upgrade docsify to 4.12.2 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-2021-30074 being exploited?
There is no known exploitation of CVE-2021-30074 in the wild and no public exploit code.
Other vulnerabilities in n/a
Sources
Also known as GHSA-5h7x-68wj-jhwc.