Inefficient Regular Expression Complexity in node-prismjs - CVE-2021-3801

node-prismjs Updated 02 Oct 2025

Summary

15/09/2021
N/A
Yes i
Medium
6.5

CVE-2021-3801: prism is vulnerable to Inefficient Regular Expression Complexity. Affects node-prismjs across 2 version ranges.

< 0ff371bb4775a131634f47d0fe85794c547232f9 < 1.23.0+dfsg-1+deb11u1

Fixed in 1.23.0+dfsg-1+deb11u1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

node-prismjs is a popular syntax highlighting library used in web applications to enhance code readability. It supports a wide range of programming languages and is widely integrated into various projects. However, it is vulnerable to an inefficient regular expression complexity issue, which can lead to performance degradation and potential denial of service in applications utilizing this library.

Vulnerability Detail

CVE-2021-3801 is a vulnerability in node-prismjs that arises from inefficient regular expression patterns. This vulnerability can be exploited by attackers to create specially crafted inputs that cause excessive backtracking in the regex engine, leading to significant performance issues. If exploited, it can result in application slowdowns or crashes, affecting user experience and system stability. The vulnerability has a CVSS score of 6.5, indicating a moderate severity level.

How To Fix

Minimum fixed version

1.23.0+dfsg-1+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade node-prismjs

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If immediate upgrading is not feasible, consider implementing input validation to sanitize user inputs before processing them with the affected library. This can help mitigate the risk of exploitation until a proper fix is applied.

Conclusion

CVE-2021-3801 presents a significant risk to applications using the node-prismjs package due to inefficient regular expression complexity. It is crucial for developers to update to the latest versions to mitigate this vulnerability and ensure optimal application performance.

See every vulnerability recorded for node-prismjs →

Share this vulnerability

FAQ

CVE-2021-3801 is a vulnerability in the node-prismjs package that allows for inefficient regular expression processing, potentially leading to performance issues.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Exploitation of this vulnerability can lead to application slowdowns or crashes, impacting user experience and system performance.

The CVSS score for CVE-2021-3801 is 6.5, indicating a moderate severity level.

You can update the package using the command: sudo apt-get install node-prismjs=1.25.0+dfsg-1 for Debian 12 and 13.

Related vulnerabilities

Recent vulnerabilities recorded for node-prismjs.

How To Fix

Minimum fixed version

1.23.0+dfsg-1+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade node-prismjs

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback