Skip to content

Commit c035d73

Browse files
committed
Fix NewDateRegex in StringExtensions restsharp#1556
Previously it had exponential worst-case complexity and was vulnerable to REDoS.
1 parent 0ed7b0a commit c035d73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/RestSharp/Extensions/StringExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace RestSharp.Extensions
2525
public static class StringExtensions
2626
{
2727
static readonly Regex DateRegex = new Regex(@"\\?/Date\((-?\d+)(-|\+)?([0-9]{4})?\)\\?/");
28-
static readonly Regex NewDateRegex = new Regex(@"newDate\((-?\d+)*\)");
28+
static readonly Regex NewDateRegex = new Regex(@"newDate\((-?\d+)\)");
2929

3030
static readonly Regex IsUpperCaseRegex = new Regex(@"^[A-Z]+$");
3131

0 commit comments

Comments
 (0)