CVE-2021-35513 Cross-site Scripting in Mermaid

Medium 6.1 Published Updated

Attackers can execute arbitrary scripts via XSS in Mermaid when the antiscript feature is enabled, affecting applications using this library.

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-35513?

CVE-2021-35513 is a medium-severity cross-site scripting vulnerability in n/a, published on 27 Jun 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

Mermaid before 8.11.0 allows XSS when the antiscript feature is used.

Weakness: CWE-79

Which versions are affected by CVE-2021-35513?

2 open source packages ship an affected version, including mermaid. It affects 1 product.

PackageAffectedFixed in
mermaid npmAll versions8.11.0
mermaid npmAll versions8.11.0

Products include Mermaid Project Mermaid.

How do I fix CVE-2021-35513?

Upgrade mermaid to 8.11.0 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-35513 being exploited?

There is no known exploitation of CVE-2021-35513 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2021-35513, GHSA-4f6x-49g2-99fm, UBUNTU-CVE-2021-35513.

Is CVE-2021-35513 in your software?

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

Check your SBOMs for free