CVE-2018-5773: markdown2 is vulnerable to cross-site scripting
6.1
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.49477%
CWE
Published
7/12/2018
Updated
9/30/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
markdown2 | pip | < 2.3.6 | 2.3.6 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from improper handling of incomplete HTML tags in safe_mode. The commit diff shows the fix introduced _encode_incomplete_tags() to escape '<' in partial tags. Before this fix, the _safety method's token processing (line 1206) directly appended raw tokens without this escaping. This matches the CVE description of XSS via unescaped incomplete tags. The _safety method is directly responsible for sanitization in safe_mode, making it the clear vulnerable function.