Miggo Logo

CVE-2020-7773:
Cross-site Scripting in markdown-it-highlightjs

6.1

CVSS Score
3.1

Basic Information

EPSS Score
0.57941%
Published
2/10/2022
Updated
9/5/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
markdown-it-highlightjsnpm< 3.3.13.3.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability exists in the inline code rendering logic where user-controlled lang parameters were insufficiently sanitized. The patch modifies the regex in inlineCodeRenderer to exclude dangerous characters, proving this was the injection point. This function directly processes the vulnerable lang attribute from markdown input and would appear in stack traces when processing malicious payloads.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

T*is *****ts t** p**k*** m*rk*own-it-*i**li**tjs ***or* *.*.*. It is possi*l* ins*rt m*li*ious J*v*S*ript *s * v*lu* o* l*n* in t** m*rk*own-it-*i**li**tjs Inlin* *o** *i**li**tin* ***tur*. ```js *onst m*rk*ownIt*i**li**tjs = r*quir*("m*rk*own-it-*

Reasoning

T** vuln*r**ility *xists in t** inlin* *o** r*n**rin* lo*i* w**r* us*r-*ontroll** l*n* p*r*m*t*rs w*r* insu**i*i*ntly s*nitiz**. T** p*t** mo*i*i*s t** r***x in `inlin**o**R*n**r*r` to *x*lu** **n**rous ***r**t*rs, provin* t*is w*s t** inj**tion poin