CVE-2026-2327: Redos Trailing Asterisks

The regular expression `/\*+$/` is vulnerable to Regular Expression Denial of Service (ReDoS). When evaluated against a long string of asterisks that does not end at the string boundary, the regular expression engine engages in catastrophic backtracking (O(N^2) complexity in many JavaScript engines). Use a manual backward iteration loop with `charCodeAt` or

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0JS
greprules fetch cve-2026-2327-redos-trailing-asterisks --engine opengrep

Description

The regular expression `/\*+$/` is vulnerable to Regular Expression Denial of Service (ReDoS). When evaluated against a long string of asterisks that does not end at the string boundary, the regular expression engine engages in catastrophic backtracking (O(N^2) complexity in many JavaScript engines). Use a manual backward iteration loop with `charCodeAt` or