DEV Community

Discussion on: Regex 101

Collapse
 
valeriavg profile image
Valeria

One should be aware of Regular Expression Denial of Service attack when validating user input on the backend.
These seemingly simple regular expressions can cause infinite loops:

(a+)+
([a-zA-Z]+)*
(a|aa)+
(a|a?)+
(.*a){x} for x \> 10
Enter fullscreen mode Exit fullscreen mode
Collapse
 
shreyazz profile image
Shreyas Pahune

Thanks for the info 😇