CVE-2022-21802: grapesjs before 0.19.5 vulnerable to Cross-site Scripting
6.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.33829%
CWE
Published
7/26/2022
Updated
1/27/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
grapesjs | npm | < 0.19.5 |
Vulnerability Intelligence
Miggo AI
Root 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.