Miggo Logo

CVE-2022-21802: grapesjs before 0.19.5 vulnerable to Cross-site Scripting

6.1

CVSS Score
3.1

Basic Information

EPSS Score
0.33829%
Published
7/26/2022
Updated
1/27/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
grapesjsnpm< 0.19.5

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from improper HTML sanitization in Selector Manager views. The commit diff shows both template functions originally used unsafe string interpolation (...${variable}...) without escaping. The patch introduced html tagged template literals (html...) which likely handles proper escaping. The vulnerable versions lacked this sanitization, allowing injection through user-controlled inputs like class names and icon markup. Both template functions directly render user-influenced content into DOM elements, making them clear XSS vectors.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

T** p**k*** *r*p*sjs ***or* *.**.* is vuln*r**l* to *ross-sit* S*riptin* (XSS) *u* to *n improp*r s*nitiz*tion o* t** *l*ss n*m* in S*l**tor M*n***r.

Reasoning

T** vuln*r**ility st*ms *rom improp*r *TML s*nitiz*tion in S*l**tor M*n***r vi*ws. T** *ommit *i** s*ows *ot* t*mpl*t* *un*tions ori*in*lly us** uns*** strin* int*rpol*tion (`...${v*ri**l*}...`) wit*out *s**pin*. T** p*t** intro*u*** *tml t***** t*mp