Fix bug Improper handling of exceptional conditions Newtonsoft#2465
Closed
WonDKim wants to merge 2 commits intoelastic:mainfrom
WonDKim:patch-1
Closed
Fix bug Improper handling of exceptional conditions Newtonsoft#2465WonDKim wants to merge 2 commits intoelastic:mainfrom WonDKim:patch-1
WonDKim wants to merge 2 commits intoelastic:mainfrom
WonDKim:patch-1
Conversation
|
💚 CLA has been signed |
|
👋 @functionofpwnosec Thanks a lot for your contribution! It may take some time before we review a PR, so even if you don’t see activity for some time, it does not mean that we have forgotten about it. Every once in a while we go through a process of prioritization, after which we are focussing on the tasks that were planned for the upcoming milestone. The prioritization status is typically reflected through the PR labels. It could be pending triage, a candidate for a future milestone, or have a target milestone set to it. |
Member
|
Thanks for the PR @functionofpwnsec 👍 This CVE is not in code we ship but the PR is most welcome regardless. I addressed this as part of #2467 so will close this PR in favour of the other. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JsonConvert.DeserializeObjectvulnerable to Insecure Defaults due to improper handling of expressions with high nesting level that lead to StackOverFlow exception or high CPU and RAM usage. Deserializing methods (likeJsonConvert.DeserializeObject) will process the input that results in burning the CPU, allocating memory, and consuming a thread of execution. Quite high nesting level (>10kk, or 9.5MB of {a:{a:{... input) is needed to achieve the latency over 10 seconds, depending on the hardware.To mitigate the issue one either need to update Newtonsoft.Json to 13.0.1 or set MaxDepth parameter in the JsonSerializerSettings. This can be done globally with the following statement. After that the parsing of the nested input will fail fast with Newtonsoft.Json.JsonReaderException:
apm-agent-dotnet/src/Elastic.Apm/BackendComm/CentralConfig/CentralConfigurationResponseParser.cs
Line 45 in 0539257
WeaknessCWE-755