Skip to content

Commit

Permalink
Set MaxDepth in JsonSerializerSettings for more secure handling of ex…
Browse files Browse the repository at this point in the history
…ceptional conditions in Newtonsoft.Json (PowerShell#1824)
  • Loading branch information
bergmeister committed Jul 26, 2022
1 parent 7395250 commit 6e0f783
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public static JsonProfileSerializer Create(Formatting formatting)
Converters = GetFormatConverters(),
MissingMemberHandling = MissingMemberHandling.Ignore,
DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate,
MaxDepth = 128,
};

var serializer = JsonSerializer.Create(settings);
Expand Down

0 comments on commit 6e0f783

Please sign in to comment.