CPU Spikes to 100% on Short Input (Regex Catastrophic Backtracking / ReDoS)
Nested quantifiers like `(a+)+$` cause exponential backtracking in NFA regex engines.
Runs locally in browser
Free · No login
Independently Verified 2026-11-25
v4.1.0
Identifier: CPU Spikes to 100% on Short Input (Regex Catastrophic Backtracking / ReDoS)
Platform: Security
Common Root Causes:
- Nested quantifiers like `(a+)+$` cause exponential backtracking in NFA regex engines.
Interactive Diagnostic Checklist
Verified Solutions:
- Rewrite patterns unambiguously without nested quantifiers or use linear-time RE2 engines.
Safe Diagnostic Command:
Audit regexes for nested quantifiers or overlapping alternations
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.
Technical Explanation
Nested quantifiers like `(a+)+$` cause exponential backtracking in NFA regex engines. Recommended diagnostic: `Audit regexes for nested quantifiers or overlapping alternations`. Remediation: Rewrite patterns unambiguously without nested quantifiers or use linear-time RE2 engines.
Worked Examples
- Run `Audit regexes for nested quantifiers or overlapping alternations` to verify root cause before applying the remediation.
Limitations & Assumptions
- Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.
Source References & Verification
Resource ID: err-data-regex-catastrophic-backtracking · Independently verified: 2026-11-25