Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/referencesource/System.Web/Configuration/RegexWorker.cs')
-rw-r--r--mcs/class/referencesource/System.Web/Configuration/RegexWorker.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/mcs/class/referencesource/System.Web/Configuration/RegexWorker.cs b/mcs/class/referencesource/System.Web/Configuration/RegexWorker.cs
index 34d9ce4cda7..2d1059b687b 100644
--- a/mcs/class/referencesource/System.Web/Configuration/RegexWorker.cs
+++ b/mcs/class/referencesource/System.Web/Configuration/RegexWorker.cs
@@ -88,7 +88,8 @@ namespace System.Web.Configuration {
target = String.Empty;
}
- Regex regex = new Regex(regexExpression, RegexOptions.ExplicitCapture);
+ // Adding timeout for Regex in case of malicious string causing DoS
+ Regex regex = RegexUtil.CreateRegex(regexExpression, RegexOptions.ExplicitCapture);
Match match = regex.Match(target);
if(match.Success == false) {
return false;