Skip to content

Commit

Permalink
Fix NewDateRegex in StringExtensions restsharp#1556
Browse files Browse the repository at this point in the history
Previously it had exponential worst-case complexity and was vulnerable to REDoS.
  • Loading branch information
b-c-ds committed Feb 16, 2021
1 parent 0ed7b0a commit c035d73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/RestSharp/Extensions/StringExtensions.cs
Expand Up @@ -25,7 +25,7 @@ namespace RestSharp.Extensions
public static class StringExtensions
{
static readonly Regex DateRegex = new Regex(@"\\?/Date\((-?\d+)(-|\+)?([0-9]{4})?\)\\?/");
static readonly Regex NewDateRegex = new Regex(@"newDate\((-?\d+)*\)");
static readonly Regex NewDateRegex = new Regex(@"newDate\((-?\d+)\)");

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

Expand Down

0 comments on commit c035d73

Please sign in to comment.