GHSA-cxp5-3px4-pw24: High severity maven/com.fasterxml.jackson.core:jackson-databind vulnerability
Summary
When an @JsonIdentityInfo collection or map first creates N unresolved object-ID references and later resolves the same IDs in reverse order, jackson-databind scans the remaining pending-reference accumulator for each resolution. A shallow JSON document whose size grows linearly can therefore cause quadratic CPU work during deserialization.
Details
The affected path is forward-reference completion in CollectionDeserializer.CollectionReferringAccumulator.resolveForwardReference() and the corresponding map implementation. The implementation performs a linear search of the pending accumulator for every resolved object ID.
The behavior is runtime-confirmed in jackson-databind 2.5.0, 2.22.1, and 3.2.1. Current 2.22 and 3.2 source branches retained the same design when rechecked. A 2.4.0 control fails closed before successful reverse-order completion, so 2.5.0 is the conservative runtime-confirmed affected floor. The patched versions are: 2.18.11, 2.21.7, 2.22.3, 3.1.7 and 3.2.3.
The vulnerable application must deserialize attacker-influenced JSON into an identity-enabled collection or map. The issue does not require deep nesting or syntactically unusual JSON.
Suggested correction: replace repeated linear lookup/removal with a keyed pending-reference structure or another design that provides linear or amortized-linear completion. A regression should preserve input order, duplicate-ID behavior, and unresolved-ID errors while bounding reverse-order resolution work.
PoC
The proof constructs a shallow collection containing N unresolved @JsonIdentityInfo references followed by definitions of those same IDs in reverse order. Its ID class counts equals() calls, giving a deterministic work measure rather than a timing-dependent result.
With N=2,000, affected versions perform exactly 2,003,000 ID comparisons. An equally sized control in which every reference is already resolved performs zero comparisons in the pending-reference lookup path. The run is bounded to a 512 MiB JVM. The result demonstrates quadratic growth: approximately N (N + 1) / 2 comparisons, plus fixed setup comparisons.
Impact
An unauthenticated source that can submit JSON to an application using the affected identity-enabled collection or map shape can consume quadratic CPU and exhaust a request-time or worker-capacity budget, causing denial of service. The application model/configuration prerequisite is material. No confidentiality, integrity, code-execution, or parser-depth impact is claimed.
Requested credit: Daniel Birtwhistle
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/com.fasterxml.jackson.core:jackson-databindto a version that resolves this vulnerability.Fixed in 2.22.3 - Upgrade
Upgrade
maven/com.fasterxml.jackson.core:jackson-databindto a version that resolves this vulnerability.Fixed in 2.18.11 - Upgrade
Upgrade
maven/tools.jackson.core:jackson-databindto a version that resolves this vulnerability.Fixed in 3.2.3 - Upgrade
Upgrade
maven/tools.jackson.core:jackson-databindto a version that resolves this vulnerability.Fixed in 3.1.7 - Upgrade
Upgrade
maven/com.fasterxml.jackson.core:jackson-databindto a version that resolves this vulnerability.Fixed in 2.21.7 - Upgrade
Upgrade
jackson-databindto a version that resolves this vulnerability.Fixed in 2.18.11 - Upgrade
Upgrade
jackson-databindto a version that resolves this vulnerability.Fixed in 2.21.7 - Upgrade
Upgrade
jackson-databindto a version that resolves this vulnerability.Fixed in 2.22.3 - Upgrade
Upgrade
jackson-databindto a version that resolves this vulnerability.Fixed in 3.1.7 - Upgrade
Upgrade
jackson-databindto a version that resolves this vulnerability.Fixed in 3.2.3
Event History
Frequently Asked Questions
Which applications are exposed to this denial-of-service issue?
An application is exposed only if it deserializes attacker-influenced JSON into a collection or map configured with @JsonIdentityInfo. The input can be shallow and otherwise ordinary JSON; deep nesting or unusual syntax is not required.
What input pattern does an attacker need to trigger excessive CPU use?
The attacker needs JSON that first creates many unresolved object-ID references and then resolves those same IDs in reverse order. Each resolution causes a scan of the remaining pending references, producing quadratic CPU work as the number of references grows.
Which versions are known to be affected or fixed?
Runtime testing confirmed the issue in jackson-databind 2.5.0, 2.22.1, and 3.2.1; 2.5.0 is the conservative confirmed affected floor. Fixed versions are 2.18.11, 2.21.7, 2.22.3, 3.1.7, and 3.2.3.
How can I determine whether my deserialization paths are affected?
Identify endpoints or processing jobs that accept attacker-influenced JSON, then check whether their target types deserialize into identity-enabled collections or maps using @JsonIdentityInfo. Such paths should be treated as affected when running a version earlier than the listed fix for its release line.