CVE-2021-32723: Regular Expression Denial of Service (ReDoS) in Prism
7.4
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.58221%
CWE
Published
6/28/2021
Updated
2/1/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
prismjs | npm | < 1.24.0 | 1.24.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from regex patterns with: 1) Unbalanced/improper character class escaping 2) Nested quantifiers without proper anchors 3) Missing negative lookaheads. The commit fixes show specific regex modifications adding missing quote handling (') in character classes and adding negative lookaheads ((?![\w$]))
to prevent ambiguous matches. These patterns are used in syntax highlighting of untrusted input, making them direct attack vectors for ReDoS when processing malicious payloads.