Regular Expression Denial of Service (ReDoS) vulnerabilities occur when poorly designed regular expressions can be exploited to cause excessive CPU consumption, potentially leading to application unavailability.
Regular Expression Denial of Service Overview
Catastrophic Backtracking
(a+)+
)Vulnerable Regex Patterns
(a+)+
or (a*b*)*
(ab|abc)+
(?>...)
when available (in languages that support them)a++
when available (in languages that support them)[a]
instead of single characters with quantifiersTimeout Mechanisms
Alternative Regex Engines
Input Validation Strategies
Testing for ReDoS Vulnerabilities
Static Analysis for ReDoS
ReDoS Prevention Checklist