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

Source: https://junglewise.ai/threats/cve-2018-5773-markdown2-is-vulnerable-to-cross-site-scripting  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2018-01-18  
License: CC BY 4.0 with a link back

CVE-2018-5773 · Severity: low · CVSS 3 · Published 2018-01-18

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.

Technologies: [markdown2 (PyPI)](https://junglewise.ai/threats/technologies/markdown2). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2018-5773 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2018-5773 being exploited in the wild.

**How severe is CVE-2018-5773?** Low severity, with a CVSS score of 3, published 18 January 2018.

**Which products and versions are affected?** markdown2 (PyPI) ECOSYSTEM:introduced=0,fixed=2.3.6.

**Is there a fix for CVE-2018-5773?** Yes. markdown2 (PyPI): upgrade to 2.3.6 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2018-5773?** Check whether you run markdown2 (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- markdown2 (PyPI): upgrade to 2.3.6 or later

  ```sh
  pip install "markdown2>=2.3.6"
  ```


## Affected products

- markdown2 (PyPI) ECOSYSTEM:introduced=0,fixed=2.3.6

## Identifiers

- CVE-2018-5773
- GHSA-p6h9-gw49-rqm4
- PYSEC-2018-13

## Related threats

- [markdown2 Regular Expression Denial of Service](https://junglewise.ai/threats/cve-2021-26813-markdown2-regular-expression-denial-of-service)
- [XSS in python-markdown2](https://junglewise.ai/threats/cve-2020-11888-xss-in-python-markdown2)
- [PYSEC-2020-235 - python-markdown2 before 1.0.1.14 has multiple cross-site scripting (XSS) issues.](https://junglewise.ai/threats/cve-2009-3724-cross-site-scripting-in-markdown2-for-python)
