Miggo Logo

CVE-2024-21907:
Improper Handling of Exceptional Conditions in Newtonsoft.Json

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.82598%
Published
6/22/2022
Updated
1/3/2024
KEV Status
No
Technology
TechnologyC#

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
Newtonsoft.Jsonnuget< 13.0.113.0.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from two key paths:

  1. Deserialization methods (e.g., JsonConvert.DeserializeObject) lacked default MaxDepth limits, allowing attackers to craft deeply nested payloads causing resource exhaustion.
  2. 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

N*wtonso*t.Json prior to v*rsion **.*.* is vuln*r**l* to Ins**ur* ****ults *u* to improp*r **n*lin* o* *xpr*ssions wit* *i** n*stin* l*v*l t**t l*** to St**kOv*r*low *x**ption or *i** *PU *n* R*M us***. *xploitin* t*is vuln*r**ility r*sults in **ni*l

Reasoning

T** vuln*r**ility st*ms *rom two k*y p*t*s: *. **s*ri*liz*tion m*t*o*s (*.*., Json*onv*rt.**s*ri*liz*O*j**t) l**k** ****ult M*x**pt* limits, *llowin* *tt**k*rs to *r**t ***ply n*st** p*ylo**s **usin* r*sour** *x**ustion. *. S*ri*liz*tion m*t*o*s (*.*