CVE-2020-36518

7.5 HIGH

📋 TL;DR

CVE-2020-36518 is a denial-of-service vulnerability in Jackson Databind where processing deeply nested JSON objects causes a Java StackOverflowError, crashing the application. This affects any Java application using vulnerable Jackson Databind versions to deserialize untrusted JSON data. The vulnerability requires no authentication and can be triggered by any user or system that can send JSON input.

💻 Affected Systems

Products:
  • Jackson Databind
  • Any Java application using Jackson Databind for JSON processing
Versions: All versions before 2.13.0
Operating Systems: All operating systems running Java applications
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in default configuration when processing untrusted JSON data. Applications must deserialize JSON from untrusted sources to be exploitable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete application crash leading to sustained denial of service, potentially affecting multiple services if Jackson is used in critical infrastructure components.

🟠

Likely Case

Application instability and intermittent crashes when processing malicious JSON payloads, resulting in service disruption.

🟢

If Mitigated

Minimal impact if input validation limits JSON depth or if the application is patched and properly configured.

🌐 Internet-Facing: HIGH - Any internet-facing service accepting JSON input could be crashed by unauthenticated attackers sending malicious payloads.
🏢 Internal Only: MEDIUM - Internal services could still be affected by malicious internal users or compromised systems, but attack surface is reduced.

🎯 Exploit Status

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

Exploitation is straightforward - send a JSON payload with deeply nested objects. No authentication required. Public proof-of-concept code exists in GitHub issues.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.13.0 or later

Vendor Advisory: https://github.com/FasterXML/jackson-databind/issues/2816

Restart Required: Yes

Instructions:

1. Update Jackson Databind dependency to version 2.13.0 or higher. 2. Update pom.xml or build.gradle to use the new version. 3. Rebuild and redeploy the application. 4. Restart the application server.

🔧 Temporary Workarounds

Input validation and depth limiting

all

Implement JSON parsing with depth limits before deserialization

// Java code example: Use JsonParser.Feature.STRICT_DUPLICATE_DETECTION
// Configure ObjectMapper with max nesting depth validation

WAF rule for JSON depth

linux

Configure web application firewall to reject JSON with excessive nesting

# Example ModSecurity rule: SecRule REQUEST_BODY "@rx \{\\s*\{\\s*\{\\s*\{\\s*\{\\s*\{\\s*\{\\s*\{\\s*\{\\s*\{" "id:1001,phase:2,deny,status:400,msg:'JSON nesting depth attack'"

🧯 If You Can't Patch

  • Implement strict input validation to limit JSON nesting depth before deserialization
  • Deploy WAF with rules to detect and block JSON payloads with excessive nesting

🔍 How to Verify

Check if Vulnerable:

Check application dependencies for Jackson Databind version. If version is below 2.13.0 and the application processes JSON from untrusted sources, it is vulnerable.

Check Version:

mvn dependency:tree | grep jackson-databind OR gradle dependencies | grep jackson-databind OR check pom.xml/build.gradle for version

Verify Fix Applied:

Verify Jackson Databind version is 2.13.0 or higher in deployed application. Test with a JSON payload containing deeply nested objects to ensure no StackOverflowError occurs.

📡 Detection & Monitoring

Log Indicators:

  • StackOverflowError in application logs
  • Java.lang.StackOverflowError exceptions
  • Application crashes during JSON processing

Network Indicators:

  • Large JSON payloads with repeated nesting patterns
  • HTTP 500 errors following JSON POST requests

SIEM Query:

source="application.logs" AND "StackOverflowError" AND "jackson" OR source="web.logs" AND status=500 AND content_type="application/json"

🔗 References

📤 Share & Export