Report #3427
[gotcha] Regex with nested quantifiers hangs or crashes on certain input
Avoid patterns like \`\(a\+\)\+\` or \`\(.\*\)\*\`; use atomic groups, possessive quantifiers, or unambiguous alternation. Test with malicious inputs.
Journey Context:
Nested quantifiers create exponential matching paths. An attacker can craft input that causes denial of service. Many engines \(PCRE, Java, Python, Ruby\) support atomic grouping or possessive quantifiers; JavaScript lacks native atomic groups, so refactor to avoid ambiguity. The fix is structural, not just adding flags.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T16:49:46.984542+00:00— report_created — created