Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newtonsoft.json.6.0.8.nupkg: 1 vulnerabilities (highest severity is: 7.5) #6

Open
mend-for-github-com bot opened this issue Jul 14, 2023 · 0 comments
Labels
Mend: dependency security vulnerability Security vulnerability detected by Mend

Comments

@mend-for-github-com
Copy link

mend-for-github-com bot commented Jul 14, 2023

Vulnerable Library - newtonsoft.json.6.0.8.nupkg

Json.NET is a popular high-performance JSON framework for .NET

Library home page: https://api.nuget.org/packages/newtonsoft.json.6.0.8.nupkg

Path to dependency file: /SamplesV1/AzureAnalysisServicesProcessSample/AzureAnalysisServicesProcessSample.csproj

Path to vulnerable library: /tmp/ws-ua_20230714210004_PUYYLY/dotnet_AASXZD/20230714210005/Newtonsoft.Json.6.0.8/Newtonsoft.Json.6.0.8.nupkg,/tmp/ws-ua_20230714210004_PUYYLY/dotnet_AASXZD/20230714210005/Newtonsoft.Json.6.0.8/Newtonsoft.Json.6.0.8.nupkg

Found in HEAD commit: 216bf28400f470d9ba71ee4e2968bdad46892af7

Vulnerabilities

CVE Severity CVSS Dependency Type Fixed in (newtonsoft.json.6.0.8.nupkg version) Remediation Available
WS-2022-0161 High 7.5 newtonsoft.json.6.0.8.nupkg Direct Newtonsoft.Json - 13.0.1;Microsoft.Extensions.ApiDescription.Server - 6.0.0

Details

WS-2022-0161

Vulnerable Library - newtonsoft.json.6.0.8.nupkg

Json.NET is a popular high-performance JSON framework for .NET

Library home page: https://api.nuget.org/packages/newtonsoft.json.6.0.8.nupkg

Path to dependency file: /SamplesV1/AzureAnalysisServicesProcessSample/AzureAnalysisServicesProcessSample.csproj

Path to vulnerable library: /tmp/ws-ua_20230714210004_PUYYLY/dotnet_AASXZD/20230714210005/Newtonsoft.Json.6.0.8/Newtonsoft.Json.6.0.8.nupkg,/tmp/ws-ua_20230714210004_PUYYLY/dotnet_AASXZD/20230714210005/Newtonsoft.Json.6.0.8/Newtonsoft.Json.6.0.8.nupkg

Dependency Hierarchy:

  • newtonsoft.json.6.0.8.nupkg (Vulnerable Library)

Found in HEAD commit: 216bf28400f470d9ba71ee4e2968bdad46892af7

Found in base branch: main

Vulnerability Details

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). \n\nThe serialization and deserialization path have different properties regarding the issue.\n\nDeserializing 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.\n\nSerializing methods (like JsonConvert.Serialize or JObject.ToString) will throw StackOverFlow exception with the nesting level of around 20k.\n\nTo 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:\n\n \nJsonConvert.DefaultSettings = () => new JsonSerializerSettings { MaxDepth = 128 };\n\n\nRepro code:\n\n//Create a string representation of an highly nested object (JSON serialized)\nint nRep = 25000;\nstring json = string.Concat(Enumerable.Repeat(\"{a:\", nRep)) + \"1\" +\n string.Concat(Enumerable.Repeat(\"}\", nRep));\n\n//Parse this object (leads to high CPU/RAM consumption)\nvar parsedJson = JsonConvert.DeserializeObject(json);\n\n// Methods below all throw stack overflow with nRep around 20k and higher\n// string a = parsedJson.ToString();\n// string b = JsonConvert.SerializeObject(parsedJson);\n\n\n### Additional affected product and version information\nThe 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.**

Publish Date: 2022-06-22

URL: WS-2022-0161

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Release Date: 2022-06-22

Fix Resolution: Newtonsoft.Json - 13.0.1;Microsoft.Extensions.ApiDescription.Server - 6.0.0

⛑️ Automatic Remediation is available for this issue


⛑️ Automatic Remediation is available for this issue.

@mend-for-github-com mend-for-github-com bot added the Mend: dependency security vulnerability Security vulnerability detected by Mend label Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mend: dependency security vulnerability Security vulnerability detected by Mend
Projects
None yet
Development

No branches or pull requests

0 participants