Add test for regular expression denial of service (ReDoS)
What would you like added?
There's nothing on regular expression denial of service (ReDoS) in the guide. A single request with a crafted string can pin a CPU when input is checked with a regex that backtracks badly, like ^(a+)+$ or the email and URL patterns copied around, and it often shows up in validation for email, usernames and search fields, both on the server and in browser code.
A test would cover spotting regex-based validation (error messages, client-side JavaScript, known library versions), timing a request with growing input such as aaaa...! to see whether the response time grows exponentially, and doing it carefully so it doesn't take down a shared environment. Remediation would point to linear-time engines (RE2, Go's regexp, .NET's NonBacktracking), match timeouts and input length limits.
It could go in 4.10 Business Logic next to the application misuse pages, or in 4.7 Input Validation, whichever fits better.
Would you like to be assigned to this issue? Check the box if you will submit a PR to add the proposed content. Please read CONTRIBUTING.md.
- [x] Assign me, please!
Moved this to 4.7 as INJT-27 in #1661, it fits better next to the other input validation tests than in BUSL.
Small correction, it's INJT-28 now since #1676 already has 27.