# CVE-2017-16876: mistune Cross-site scripting (XSS) vulnerability

Source: https://junglewise.ai/threats/cve-2017-16876-mistune-cross-site-scripting-xss-vulnerability  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2017-12-29  
License: CC BY 4.0 with a link back

CVE-2017-16876 · Severity: low · CVSS 3.1 · Published 2017-12-29

Cross-site scripting (XSS) vulnerability in the _keyify function in mistune.py in Mistune before 0.8.1 allows remote attackers to inject arbitrary web script or HTML by leveraging failure to escape the "key" argument.

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

## Quick answers

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

**How severe is CVE-2017-16876?** Low severity, with a CVSS score of 3.1, published 29 December 2017.

**Which products and versions are affected?** mistune (PyPI) ECOSYSTEM:introduced=0,fixed=0.8.1, GIT:introduced=0,fixed=5f06d724bc05580e7f203db2d4a4905fc1127f98|ECOSYSTEM:introduced=0,fixed=0.8.1.

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

**Am I affected by CVE-2017-16876?** Check whether you run mistune (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

- mistune (PyPI): upgrade to 0.8.1 or later

  ```sh
  pip install "mistune>=0.8.1"
  ```


## Affected products

- mistune (PyPI) ECOSYSTEM:introduced=0,fixed=0.8.1, GIT:introduced=0,fixed=5f06d724bc05580e7f203db2d4a4905fc1127f98|ECOSYSTEM:introduced=0,fixed=0.8.1

## Identifiers

- CVE-2017-16876
- GHSA-98gj-wwxm-cj3h
- PYSEC-2017-18

## Related threats

- [Mistune path traversal and XSS in Include directive](https://junglewise.ai/threats/duplicate-advisory-mistune-path-traversal-and-xss-in-include-directive-bf25c187)
- [Mistune path traversal and XSS in Include directive](https://junglewise.ai/threats/cve-2026-115355-mistune-before-3-3-0-contains-a-path-traversal-vulnerability-in)
- [Mistune uncontrolled recursion in HTML rendering](https://junglewise.ai/threats/cve-2026-76098-mistune-uncontrolled-recursion-in-html-rendering)
- [lepture Mistune predictable ID generation in TOC plugin](https://junglewise.ai/threats/cve-2026-59930-lepture-mistune-predictable-id-generation-in-toc-plugin)
- [lepture mistune XSS via incomplete URL scheme filtering in HTML renderer](https://junglewise.ai/threats/cve-2026-59929-lepture-mistune-xss-via-incomplete-url-scheme-filtering-in-html)
