CVE-2016-10531 Sanitization bypass using HTML Entities in marked

Medium 6.1 Published Updated

Attackers can bypass sanitization to inject JavaScript URLs, enabling cross-site scripting attacks in applications using the marked 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-2016-10531?

CVE-2016-10531 is a medium-severity cross-site scripting vulnerability in HackerOne marked node module, published on 31 May 2018. 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

marked is an application that is meant to parse and compile markdown. Due to the way that marked 0.3.5 and earlier parses input, specifically HTML entities, it's possible to bypass marked's content injection protection (`sanitize: true`) to inject a `javascript:` URL. This flaw exists because `&#xNNanything;` gets parsed to what it could and leaves the rest behind, resulting in just `anything;` being left.

Weakness: CWE-79

Which versions are affected by CVE-2016-10531?

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

PackageAffectedFixed in
marked npmAll versions0.3.6
marked npmAll versions0.3.6

Products include Marked Project Marked.

How do I fix CVE-2016-10531?

Upgrade marked to 0.3.6 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-2016-10531 being exploited?

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

Sources

Also known as CVE-2016-1000013, DEBIAN-CVE-2016-10531, GHSA-vfvf-mqq8-rwqc, UBUNTU-CVE-2016-10531.

Is CVE-2016-10531 in your software?

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

Check your SBOMs for free