Miggo Logo

CVE-2022-23647: Cross-site Scripting in Prism

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.23263%
Published
2/22/2022
Updated
2/3/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L
Package NameEcosystemVulnerable VersionsFirst Patched Version
prismjsnpm>= 1.14.0, < 1.27.01.27.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from unescaped output in the Command Line plugin's output rendering logic. The commit diff shows the critical fix was adding Prism.util.encode() to outputLines[i] in the code that generates <span class='token output'> elements. This code path executes in the 'before-insert' hook handler, which processes untrusted input without proper sanitization in vulnerable versions. The direct modification of this specific code block in the patch confirms this as the vulnerability location.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t Prism's [*omm*n* lin* plu*in](*ttps://prismjs.*om/plu*ins/*omm*n*-lin*/) **n ** us** *y *tt**k*rs to ***i*v* *n XSS *tt**k. T** *omm*n* lin* plu*in *i* not prop*rly *s**p* its output, l***in* to t** input t*xt **in* ins*rt** into t** *OM *

Reasoning

T** vuln*r**ility st*ms *rom un*s**p** output in t** *omm*n* Lin* plu*in's output r*n**rin* lo*i*. T** *ommit *i** s*ows t** *riti**l *ix w*s ***in* `Prism.util.*n*o**()` to outputLin*s[i] in t** *o** t**t **n*r*t*s <sp*n *l*ss='tok*n output'> *l*m*n