Skip to content

Latest commit

 

History

History
17 lines (11 loc) · 557 Bytes

MA0009.md

File metadata and controls

17 lines (11 loc) · 557 Bytes

MA0009 - Add regex evaluation timeout

new Regex(""); // not compliant
new Regex("", RegexOptions.None); // notcompliant

new Regex("", RegexOptions.None, TimeSpan.FromSeconds(1)); // ok

[GeneratedRegex(""pattern"", RegexOptions.None)] // not compliant
private static partial Regex Test();

[GeneratedRegex(""pattern"", RegexOptions.None, matchTimeoutMilliseconds: 1000)] // ok compliant
private static partial Regex Test();

More information: Regex - Deny of Service (ReDoS)