CVE-2021-32723
JSON

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 packageVersionsReported by
PrismJS prism< 1.24, before 1.24.0CVE List, NVD
prismjs (npm)before 1.24.0GitHub Advisory Database
oracle application_expressbefore 21.1.4NVD

All scores

GitHub_M7.4high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:N/A:H
GitHub7.4high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:N/A:H
NVD6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NVD4.3medium CVSS:2.0AV: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

Sources

SourceRecordLicence
CVE ListCVE-2021-32723 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-gj77-59wh-66hg changed 2026-07-08CC-BY-4.0
NVDCVE-2021-32723 changed 2026-06-17Public domain