CVE-2025-52999: jackson-core Deep Nesting Stack Overflow Denial of Service Vulnerability
8.7
Basic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
com.fasterxml.jackson.core:jackson-core | maven | < 2.15.0 | 2.15.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability is a classic stack-based buffer overflow, specifically a StackOverflowError
in Java, caused by unbounded recursion. This occurs in various JSON parser implementations within the jackson-core
library. The root cause is the lack of a depth check before creating a new JsonReadContext
when the parser encounters the start of a nested JSON object ({
) or array ([
).
An attacker can craft a JSON input with an extremely large number of nested structures. When any of the jackson parsers (e.g., ReaderBasedJsonParser
, UTF8StreamJsonParser
) process this input, they recursively call methods to handle the nested content. Each level of nesting creates a new JsonReadContext
object on the call stack. Without a limit, this chain of object creation continues until the stack space is exhausted, throwing a StackOverflowError
and causing the application to crash, resulting in a denial of service.
The patch addresses this by introducing a configurable maxNestingDepth
constraint. It adds new helper methods, createChildArrayContext
and createChildObjectContext
, in the base parser class ParserBase
. These methods are now responsible for creating new contexts and, crucially, they first call validateNestingDepth
to ensure the limit is not exceeded. The vulnerable functions identified are the various parser methods (nextToken
, _nextAfterName
, etc.) that were modified to use these new, safe helper methods instead of creating contexts directly. Any of these functions would appear in a stack trace during the exploitation of this vulnerability.
Vulnerable functions
com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken
src/main/java/com/fasterxml/jackson/core/json/ReaderBasedJsonParser.java
com.fasterxml.jackson.core.json.UTF8StreamJsonParser._nextTokenNotInObject
src/main/java/com/fasterxml/jackson/core/json/UTF8StreamJsonParser.java
com.fasterxml.jackson.core.json.UTF8DataInputJsonParser._nextTokenNotInObject
src/main/java/com/fasterxml/jackson/core/json/UTF8DataInputJsonParser.java
com.fasterxml.jackson.core.json.async.NonBlockingJsonParserBase._startArrayScope
src/main/java/com/fasterxml/jackson/core/json/async/NonBlockingJsonParserBase.java
com.fasterxml.jackson.core.json.async.NonBlockingJsonParserBase._startObjectScope
src/main/java/com/fasterxml/jackson/core/json/async/NonBlockingJsonParserBase.java