Miggo Logo

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

6.1

CVSS Score
3.0

Basic Information

EPSS Score
0.49477%
Published
7/12/2018
Updated
9/30/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
markdown2pip< 2.3.62.3.6

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*n issu* w*s *is*ov*r** in `m*rk*own*` (*k* pyt*on-m*rk*own*) t*rou** *.*.*. T** `s***_mo**` ***tur*, w*i** is suppos** to s*nitiz* us*r input ***inst XSS, is *l*w** *n* *o*s not *s**p* t** input prop*rly. Wit* * *r**t** p*ylo**, XSS **n ** tri***r**

Reasoning

T** vuln*r**ility st*mm** *rom improp*r **n*lin* o* in*ompl*t* *TML t**s in s***_mo**. T** *ommit *i** s*ows t** *ix intro*u*** _*n*o**_in*ompl*t*_t**s() to *s**p* '<' in p*rti*l t**s. ***or* t*is *ix, t** _s***ty m*t*o*'s tok*n pro**ssin* (lin* ****