CVE-2022-23647: Cross-site Scripting in Prism
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.23263%
CWE
Published
2/22/2022
Updated
2/3/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
prismjs | npm | >= 1.14.0, < 1.27.0 | 1.27.0 |
Vulnerability Intelligence
Miggo AI
Root 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.