CVE-2024-21907

7.5 HIGH

📋 TL;DR

Newtonsoft.Json versions before 13.0.1 contain a vulnerability where specially crafted JSON data can trigger a StackOverflowException when deserialized, causing denial of service. This affects any application using vulnerable versions of the library for JSON parsing. Remote, unauthenticated attackers could potentially crash applications by sending malicious JSON payloads.

💻 Affected Systems

Products:
  • Newtonsoft.Json (Json.NET)
  • Any application using Newtonsoft.Json library
Versions: All versions before 13.0.1
Operating Systems: All platforms where Newtonsoft.Json runs (Windows, Linux, macOS)
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in default configuration when using JsonConvert.DeserializeObject method.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete application crash and denial of service for all users, potentially requiring manual restart of affected services.

🟠

Likely Case

Application crashes when processing malicious JSON input, causing temporary service disruption until automatic or manual recovery.

🟢

If Mitigated

Minimal impact with proper input validation and updated library versions preventing exploitation.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires sending crafted JSON data to applications that deserialize untrusted input.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 13.0.1 and later

Vendor Advisory: https://github.com/JamesNK/Newtonsoft.Json/commit/7e77bbe1beccceac4fc7b174b53abfefac278b66

Restart Required: Yes

Instructions:

1. Update Newtonsoft.Json NuGet package to version 13.0.1 or later. 2. Rebuild and redeploy affected applications. 3. Restart services using the updated library.

🔧 Temporary Workarounds

Input Validation and Size Limits

all

Implement input validation and size limits on JSON data before deserialization

WAF/Proxy Protection

all

Configure web application firewalls or reverse proxies to block or limit large JSON payloads

🧯 If You Can't Patch

  • Implement strict input validation to reject malformed JSON before deserialization
  • Deploy rate limiting and request size limits to prevent exploitation attempts

🔍 How to Verify

Check if Vulnerable:

Check Newtonsoft.Json assembly version in application dependencies or NuGet package references

Check Version:

For .NET applications: check packages.config or .csproj file for Newtonsoft.Json package version

Verify Fix Applied:

Verify Newtonsoft.Json version is 13.0.1 or higher in application dependencies

📡 Detection & Monitoring

Log Indicators:

  • StackOverflowException in application logs
  • Application crash/restart events
  • Unusually large JSON payloads in request logs

Network Indicators:

  • Large JSON payloads to deserialization endpoints
  • Repeated crash/restart patterns

SIEM Query:

source="application_logs" AND ("StackOverflowException" OR "Newtonsoft.Json" AND "crash")

🔗 References

📤 Share & Export