7.4high
Regular Expression Denial of Service (ReDoS) in Prism
- Severity
- 7.4high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.42% (higher than 73% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-gj77-59wh-66hg
Description
Prism is a syntax highlighting library. Some languages before 1.24.0 are vulnerable to Regular Expression Denial of Service (ReDoS). When Prism is used to highlight untrusted (user-given) text, an attacker can craft a string that will take a very very long time to highlight. This problem has been fixed in Prism v1.24. As a workaround, do not use ASCIIDoc or ERB to highlight untrusted text. Other languages are not affected and can be used to highlight untrusted text.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| PrismJS prism | < 1.24, before 1.24.0 | CVE List, NVD |
| prismjs (npm) | before 1.24.0 | GitHub Advisory Database |
| oracle application_express | before 21.1.4 | NVD |
All scores
| GitHub_M | 7.4high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:N/A:H |
| GitHub | 7.4high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:N/A:H |
| NVD | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
| NVD | 4.3medium CVSS:2.0 | AV:N/AC:M/Au:N/C:N/I:N/A:P |
Classification
What each source says
CVE List
Prism is a syntax highlighting library. Some languages before 1.24.0 are vulnerable to Regular Expression Denial of Service (ReDoS). When Prism is used to highlight untrusted (user-given) text, an attacker can craft a string that will take a very very long time to highlight. This problem has been fixed in Prism v1.24. As a workaround, do not use ASCIIDoc or ERB to highlight untrusted text. Other languages are not affected and can be used to highlight untrusted text.
GitHub Advisory Database
Some languages before 1.24.0 are vulnerable to Regular Expression Denial of Service (ReDoS).
Impact
When Prism is used to highlight untrusted (user-given) text, an attacker can craft a string that will take a very very long time to highlight. Do not use the following languages to highlight untrusted text.
- ASCIIDoc
- ERB
Other languages are not affected and can be used to highlight untrusted text.
Patches
This problem has been fixed in Prism v1.24.
References
- PrismJS/prism#2774
- PrismJS/prism#2688
NVD (es)
Prism es una biblioteca de resaltado de sintaxis. Algunos lenguajes anteriores a la versión 1.24.0, son vulnerables a una Denegación de Servicio por Expresiones Regulares (ReDoS). Cuando Prism es usado para resaltar texto no confiable (dado por el usuario), un atacante puede diseñar una cadena que tardará mucho tiempo en ser resaltada. Este problema ha sido corregido en Prism versión v1.24. Como solución alternativa , no utilice ASCIIDoc o ERB para resaltar texto no confiable. Otros lenguajes no están afectados y pueden ser usados para resaltar texto no confiable
References
| https://github.com/PrismJS/prism/security/advisories/GHSA-gj77-59wh-66hg | third-party-advisory, web | |
| https://github.com/PrismJS/prism/pull/2688 | patch, third-party-advisory, web | |
| https://github.com/PrismJS/prism/pull/2774 | patch, third-party-advisory, web | |
| https://www.oracle.com/security-alerts/cpujan2022.html | patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-32723 | advisory | |
| https://github.com/PrismJS/prism/commit/d85e30da6755fdbe7f8559f8e75d122297167018 | web | |
| https://github.com/PrismJS/prism | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-32723 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-gj77-59wh-66hg changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-32723 changed 2026-06-17 | Public domain |