Update dependency Newtonsoft.Json to v13 [SECURITY] #15
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.
This PR contains the following updates:
12.0.3
->13.0.1
GitHub Vulnerability Alerts
CVE-2024-21907
Newtonsoft.Json prior to version 13.0.1 is vulnerable to Insecure Defaults due to improper handling of expressions with high nesting level that lead to StackOverFlow exception or high CPU and RAM usage. Exploiting this vulnerability results in Denial Of Service (DoS).
The serialization and deserialization path have different properties regarding the issue.
Deserializing methods (like
JsonConvert.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.Serializing methods (like
JsonConvert.Serialize
orJObject.ToString
) will throw StackOverFlow exception with the nesting level of around 20k.To mitigate the issue one either need to update Newtonsoft.Json to 13.0.1 or set
MaxDepth
parameter in theJsonSerializerSettings
. This can be done globally with the following statement. After that the parsing of the nested input will fail fast withNewtonsoft.Json.JsonReaderException
:Repro code:
Additional affected product and version information
The original statement about the problem only affecting IIS applications is misleading. Any application is affected, however the IIS has a behavior that stops restarting the instance after some time resulting in a harder-to-fix DoS.**
Release Notes
JamesNK/Newtonsoft.Json (Newtonsoft.Json)
v13.0.1
Compare Source
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.