ReDoS is a denial of service where a crafted input makes a backtracking regex take exponential time, so a handful of requests can pin every core and take an API down. In .NET you defend in layers: limit input length before matching; avoid nested quantifiers like (a+)+ and overlapping alternations; use RegexOptions.NonBacktracking (added in .NET 7, linear time) when you don't need backreferences or lookarounds; always set a match timeout on untrusted input; and prefer [GeneratedRegex] so the pattern is compiled and reviewable. Treat it as a security finding in the threat model, not just a performance bug.
Checks whether the candidate treats input-driven CPU burn as a security issue
Last updated 23 Nov 2026.