Executive brief
The esm JavaScript module loader contains a regular expression parsing bug that can cause infinite loops or memory exhaustion when processing certain identifier patterns. An attacker who can control module imports (e.g., through malicious code or a dependency) can trigger this condition, causing the application to hang or crash and disrupting service availability.
Technical details
A Regular Expression Denial of Service (ReDoS) vulnerability exists in esm's find-indexes module, which constructs regex patterns from unescaped identifiers. When special regex metacharacters like '