CVE-2021-30074 Docsify vulnerable to cross-site scripting due to mishandled encoding

Medium 6.1 Published Updated

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.

PackageAffectedFixed in
docsify npmAll versions4.12.2
docsify npmAll versions4.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.

Sources

Also known as GHSA-5h7x-68wj-jhwc.

Is CVE-2021-30074 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free