CVE-2024-21907:
Improper Handling of Exceptional Conditions in Newtonsoft.Json
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.82598%
CWE
Published
6/22/2022
Updated
1/3/2024
KEV Status
No
Technology
C#
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
Newtonsoft.Json | nuget | < 13.0.1 | 13.0.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from two key paths:
- Deserialization methods (e.g., JsonConvert.DeserializeObject) lacked default MaxDepth limits, allowing attackers to craft deeply nested payloads causing resource exhaustion.
- Serialization methods (e.g., JObject.ToString, JsonConvert.SerializeObject) used recursive algorithms without stack depth checks, leading to unavoidable StackOverflowExceptions. The GitHub commit 7e77bbe explicitly shows MaxDepth default changes in JsonReader/JsonSerializer, confirming these functions' involvement. Reproduction code directly demonstrates exploitation through these entry points.