CVE-2018-5773 markdown2 is vulnerable to cross-site scripting

Medium 6.1 Published Updated

Attackers can execute arbitrary scripts via crafted input when the safe_mode feature is enabled in the markdown2 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-2018-5773?

CVE-2018-5773 is a medium-severity cross-site scripting vulnerability in n/a, published on 18 Jan 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

An issue was discovered in markdown2 (aka python-markdown2) through 2.3.5. The safe_mode feature, which is supposed to sanitize user input against XSS, is flawed and does not escape the input properly. With a crafted payload, XSS can be triggered, as demonstrated by omitting the final '>' character from an IMG tag.

Weakness: CWE-79

Which versions are affected by CVE-2018-5773?

3 open source packages ship an affected version, including markdown2. It affects 1 product.

PackageAffectedFixed in
markdown2 PyPIAll versions2.3.6
markdown2 PyPIAll versions2.3.6
markdown2 PyPIAll versions2.3.6

Products include Python-Markdown2 Project Python-Markdown2.

How do I fix CVE-2018-5773?

Upgrade markdown2 to 2.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-2018-5773 being exploited?

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

Sources

Also known as GHSA-p6h9-gw49-rqm4, PYSEC-2018-13.

Is CVE-2018-5773 in your software?

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

Check your SBOMs for free