The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2024-21907

CVE-2024-21907: Newtonsoft Json.NET DoS Vulnerability

CVE-2024-21907 is a denial of service vulnerability in Newtonsoft Json.NET that triggers StackOverflow exceptions through crafted data. This article covers the technical details, affected versions, impact, and mitigation.

Published: January 28, 2026

CVE-2024-21907 Overview

CVE-2024-21907 is a Denial of Service vulnerability affecting Newtonsoft.Json, one of the most widely-used JSON serialization libraries in the .NET ecosystem. The vulnerability stems from improper handling of exceptional conditions when processing deeply nested JSON structures. Crafted data passed to the JsonConvert.DeserializeObject method can trigger a StackOverflow exception, resulting in denial of service. Due to the network-accessible nature of many applications using this library, unauthenticated remote attackers may be able to exploit this vulnerability to cause service disruption.

Critical Impact

Remote attackers can crash .NET applications using vulnerable versions of Newtonsoft.Json by sending specially crafted deeply-nested JSON payloads, causing stack exhaustion and service unavailability.

Affected Products

  • Newtonsoft Json.NET versions prior to 13.0.1
  • Applications and services utilizing vulnerable Newtonsoft.Json NuGet packages
  • .NET applications processing untrusted JSON input without depth limits

Discovery Timeline

  • 2024-01-03 - CVE-2024-21907 published to NVD
  • 2025-11-28 - Last updated in NVD database

Technical Details for CVE-2024-21907

Vulnerability Analysis

This vulnerability is classified under CWE-755 (Improper Handling of Exceptional Conditions). The core issue lies in how Newtonsoft.Json handles deeply nested JSON structures during deserialization. Prior to version 13.0.1, the library did not enforce a default maximum depth limit when parsing JSON data. This architectural decision meant that maliciously crafted JSON with excessive nesting levels could consume stack space recursively until the application's stack is exhausted, triggering a StackOverflowException.

The vulnerability is particularly dangerous because StackOverflowException in .NET is a fatal exception that cannot be caught or handled by application code, causing immediate process termination. This makes it an effective vector for denial of service attacks against web APIs, microservices, and any application that deserializes JSON from untrusted sources.

Root Cause

The root cause is the absence of a default maximum depth constraint in the JsonReader and JsonSerializer classes. When processing JSON input, the library recursively parses nested objects and arrays. Without depth limits, an attacker can craft JSON with thousands of nested levels, causing the parser to make an equivalent number of recursive calls. Each recursive call consumes stack memory, and when the stack is exhausted, the runtime throws an unrecoverable StackOverflowException.

Attack Vector

The attack vector is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by sending a malicious HTTP request containing deeply nested JSON to any endpoint that deserializes JSON using vulnerable versions of Newtonsoft.Json. The attack payload is straightforward to construct—simply generate JSON with excessive nesting depth such as {"a":{"a":{"a":...}}} repeated thousands of times.

text
// Security patch in Src/Newtonsoft.Json/JsonReader.cs
// Change JsonReader and JsonSerializer default max depth to 128 (#2462)
 
         /// <summary>
         /// Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a <see cref="JsonReaderException"/>.
+        /// A null value means there is no maximum. 
+        /// The default value is <c>128</c>.
         /// </summary>
         public int? MaxDepth
         {

Source: GitHub Commit Reference

text
// Security patch in Src/Newtonsoft.Json/JsonSerializer.cs
// Change JsonReader and JsonSerializer default max depth to 128 (#2462)
         /// <summary>
         /// Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a <see cref="JsonReaderException"/>.
         /// A null value means there is no maximum.
-        /// The default value is <c>null</c>.
+        /// The default value is <c>128</c>.
         /// </summary>
         public virtual int? MaxDepth
         {

Source: GitHub Commit Reference

Detection Methods for CVE-2024-21907

Indicators of Compromise

  • Application crashes with StackOverflowException in JSON parsing routines
  • Unusual HTTP requests containing extremely large JSON payloads with deep nesting
  • Process terminations in services handling JSON deserialization without corresponding application errors in logs
  • Repeated service restarts correlated with specific API endpoint requests

Detection Strategies

  • Implement software composition analysis (SCA) to identify Newtonsoft.Json versions below 13.0.1 in your dependency tree
  • Monitor application crash dumps for stack traces indicating recursive calls in Newtonsoft.Json namespace
  • Use web application firewalls (WAF) to detect and block JSON payloads with excessive nesting depth
  • Audit NuGet package references across all .NET projects using dotnet list package --vulnerable

Monitoring Recommendations

  • Configure application performance monitoring (APM) to alert on sudden process terminations
  • Implement request body size limits at the load balancer and API gateway level
  • Set up log aggregation to correlate service crashes with incoming request patterns
  • Monitor memory and CPU utilization for signs of resource exhaustion attacks

How to Mitigate CVE-2024-21907

Immediate Actions Required

  • Upgrade Newtonsoft.Json to version 13.0.1 or later immediately across all affected applications
  • If immediate upgrade is not possible, explicitly configure MaxDepth property on JsonSerializerSettings to a safe value
  • Review all entry points that accept JSON input from untrusted sources
  • Deploy updated applications to production with proper testing validation

Patch Information

The fix was implemented in GitHub Pull Request #2462, which changes the default MaxDepth value from null (unlimited) to 128 in both JsonReader and JsonSerializer classes. This ensures that even applications that do not explicitly configure depth limits are protected by a reasonable default. The patched version is available via NuGet as Newtonsoft.Json 13.0.1 and later. For detailed technical analysis, see the GitHub Security Advisory and Snyk Vulnerability Report.

Workarounds

  • For applications that cannot be upgraded immediately, configure JsonSerializerSettings with an explicit MaxDepth value
  • Implement input validation at the API layer to reject JSON payloads exceeding reasonable size or complexity thresholds
  • Use middleware to enforce request body size limits before JSON parsing occurs
  • Consider implementing custom JSON parsing with iterative (non-recursive) algorithms for high-risk endpoints
csharp
# Configuration example - Set explicit MaxDepth to prevent stack overflow
var settings = new JsonSerializerSettings
{
    MaxDepth = 64  // Adjust based on your application's requirements
};
var result = JsonConvert.DeserializeObject<MyType>(jsonInput, settings);

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechNewtonsoft Json

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability3.04%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-755
  • Technical References
  • Aleph Security Analysis

  • Aleph Security Vulnerability

  • GitHub Issue Discussion

  • GitHub Security Advisory

  • Snyk Vulnerability Report

  • VulnCheck Advisory
  • Vendor Resources
  • GitHub Commit Reference

  • GitHub Pull Request
  • Latest CVEs
  • CVE-2026-43328: Linux Kernel Use-After-Free Vulnerability

  • CVE-2026-43329: Linux Kernel Netfilter DoS Vulnerability

  • CVE-2026-43330: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-43331: Linux Kernel DOS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English