Skip to content

Commit bfae8d3

Browse files
Add timeout to regex matching to prevent ReDoS
Co-authored-by: waldekmastykarz <11164679+waldekmastykarz@users.noreply.github.com>
1 parent ecb9b33 commit bfae8d3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

DevProxy.Plugins/Mocking/MockStdioResponsePlugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ Configuration.Mocks is null ||
268268

269269
// Check if stdin matches the body regex
270270
if (hasBodyRegex &&
271-
!Regex.IsMatch(stdinBody, mockResponse.Request.BodyRegex!, RegexOptions.IgnoreCase))
271+
!Regex.IsMatch(stdinBody, mockResponse.Request.BodyRegex!, RegexOptions.IgnoreCase, TimeSpan.FromSeconds(5)))
272272
{
273273
return false;
274274
}

0 commit comments

Comments
 (0)