JavaScript · Senior · Question 32 of 75
What is ReDoS?
- ✓Correct answer: Denial of service caused by a "heavy" regular expression
- 2An attack where the server redirects requests to a foreign domain
- 3Resubmitting a form when the browser reloads the page
Explanation
Expressions like /^(a+)+$/ on a specially crafted string take exponential time and block the thread (especially dangerous on a Node.js server). Avoid nested quantifiers, limit input length, use safe engines.