Intel

AIKIDO-2025-10417

highlightjs-cshtml-razor is vulnerable to Regular Expression Denial of Service (ReDoS)

Regular Expression Denial of Service (ReDoS) Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Jun 27, 2025

53

Medium Risk

This Affects:

jshighlightjs-cshtml-razor
2.0.0 - 2.1.2
Fixed in 2.2.0
Are you affected? Scan for Free

TL;DR

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via Polynomial Backtracking in Razor syntax highlighting. The vulnerability stemmed from an inefficient regex pattern used to parse @ directives in Razor code. An attacker could exploit this flaw by injecting a malicious string with excessive consecutive characters, causing catastrophic backtracking that exponentially increases CPU processing time and leads to application hang or denial of service.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Background info

highlightjs-cshtml-razor is vulnerable to Regular Expression Denial of Service (ReDoS) in versions 2.0.0 - 2.1.2.

How to fix this

Upgrade the highlightjs-cshtml-razor library to the patch version.