Skip to content
OpenAdvisories
High · 7.4 CVE-2021-32723 EUVD-2021-1326GHSA-gj77-59wh-66hg

Regular Expression Denial of Service (ReDoS) in Prism

Published Jun 28, 2021 · Updated Aug 3, 2024 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
PrismJS prism < 1.24 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Ubuntu 26.10 node-prismjs No fix yet —
Ubuntu 26.04 LTS node-prismjs No fix yet —
Ubuntu 25.10 node-prismjs No fix yet —
Ubuntu 24.04 LTS node-prismjs No fix yet —
Ubuntu 22.04 LTS node-prismjs No fix yet —
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 20.04 LTS node-prismjs No fix yet —

Affected packages

EcosystemPackageAffectedFixedRecord
npm prismjs < 1.24.0 1.24.0 GHSA-gj77-59wh-66hg

References