Overview
About vulnerability
Summary
With @JsonTypeInfo(use = Id.NAME, defaultImpl = ...), every distinct unknown
raw type ID selects the same fallback deserializer but is retained as a
separate key in TypeDeserializerBase._deserializers. An attacker who can
repeatedly supply new unknown type IDs can grow this process-lifetime cache
without a configured bound.
Details
The affected path is TypeDeserializerBase._findDeserializer(). After an
unknown name-based type ID resolves to the configured fallback/default
implementation, jackson-databind caches the result under the attacker-provided
raw typeId. Although all such IDs select the same fallback deserializer, each
new string remains a distinct cache key.
The behavior is runtime-confirmed in jackson-databind 2.22.1 and 3.2.1.
Current 2.22 and 3.2 source branches retained the unbounded _deserializers
map and per-raw-ID cache write when rechecked. The earlier affected floor has
not been established, patched versions are: 2.18.11, 2.21.7, 2.22.3, 3.1.7 and 3.2.3.
The vulnerable application must enable name-based polymorphism with a
defaultImpl or equivalent fallback, accept attacker-influenced type IDs, and
reuse a long-lived mapper/type deserializer across requests.
Suggested correction: avoid caching each unknown raw ID when every such ID resolves to the same fallback, use a fallback sentinel, or use an explicitly bounded concurrency-safe cache. A regression should contrast many distinct unknown IDs with repetitions of one unknown ID across requests.
PoC
Configure a polymorphic base type with
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, defaultImpl = Fallback.class) and
deserialize inputs containing unknown type names through the same mapper.
Inspect TypeDeserializerBase._deserializers after the run.
On affected 2.x and 3.x versions, 10,000 distinct unknown raw type IDs produce 10,000 retained cache entries even though every input selects the same fallback deserializer. A matched control that repeats one unknown ID 10,000 times produces one retained entry. This isolates attacker-controlled key cardinality from ordinary request count.
Impact
Where the stated polymorphic fallback configuration is exposed to attacker-influenced type IDs, distinct inputs cause incremental process-lifetime memory retention and eventual availability pressure or denial of service. This is not claimed as a single-request allocation spike, and no fixed bytes-per-ID or time-to-out-of-memory value is asserted. No confidentiality, integrity, or code-execution impact is claimed.
Requested credit: Daniel Birtwhistle
Details
- Affected product:
- AlmaLinux 9.2 ESU , Apache CXF , Apache Hadoop , Apache Hive , Apache Kafka , Apache Log4j , Apache Maven , Apache Solr , Apache Spark , Apache Struts , Eclipse Jersey , Eclipse Jetty , Elasticsearch , Hazelcast , Hibernate , Jackson , OpenSearch , Spring , TuxCare 9.6 ESU , TuxCare 9.8 ESU , Wildfly , accumulo , activemq , agepredictor , airlift , alluxio , amazon-kinesis-client , amazon-kinesis-producer , apicurio-common-rest-client , apicurio-registry , apicurio-registry-operator , archaius , ardielle-java , arrow , artemis , athenz , avro , aws-glue-schema-registry , aws-sdk-java , aws-sdk-java-v2 , aws-secretsmanager-caching-java , aws-secretsmanager-jdbc , aws-xray-sdk-java , azure-cosmosdb-java , azure-kusto-java , azure-sdk-for-java , azure-search-documents , azure-spring-data-cosmos , bmc-oke-workload-identity , bookkeeper , bytebuffer-collections , calcite , camel , canal , carrot2 , cassandra-java-driver , client_java , com.amazonaws:aws-java-sdk-chimesdkmediapipelines , com.amazonaws:aws-java-sdk-drs , com.amazonaws:aws-java-sdk-migrationhubrefactorspaces , com.azure:azure-core-amqp , com.azure:azure-core-serializer-json-jackson , com.github.jsonld-java:jsonld-java , com.wavefront:wavefront-sdk-java , consul-client , corda , cos-java-sdk-v5 , cos-java-sdk-v5-bundle , couchbase-jvm-clients , couchbase-jvm-clients-core-io , couchbase-jvm-clients-java-client , curator , debezium , deeplearning4j , discovery , docker-java , docx4j , docx4j-ImportXHTML , docx4j-export-FO , droolsjbpm-integration , druid , dynamodb-streams-kinesis-adapter , emitter , etcd4j , eureka , fabric8 , flink , flume , geode , geode-lucene , geoip2 , glassfish , glassfish-hk2 , grails-async , grails-core , grails-data-mapping , grails-gsp , grails-plugin-converters , graphql-java-servlet , groovy , hbase , hbase-thirdparty , http-client , huaweicloud-sdk-java-obs , hystrix , ignite , incubator-retired-htrace , incubator-retired-slider , infinispan , io.airlift:jmx , io.airlift:jmx-http , io.apicurio:apicurio-common-rest-client-jdk , jaeger-client-java , jasperreports , java-apns , java-cas-client , java-couchbase-encryption , java-driver , java-genai , java-jwt , java-opensaml , java-sdk , java-util , jena , jersey , jgroups-aws , jjwt , jolt , json-flattener , json-patch , json-schema-core , json-schema-validator , json4s , jsonpath , jsonschema-generator , jsonschema2pojo , jwks-rsa-java , karaf , kinesis-logback-appender , kite , kubernetes-client , logging-flume , logging-flume-irc , maxmind-db-reader-java , maxminddb , mbknor-jackson-jsonschema , mcp-annotations , metrics , micrometer , micrometer-tracing , micronaut-cache , micronaut-core , micronaut-spring , microsoft-authentication-library-for-java , mockwebserver , mustache.java , nd4j , neo4j-java-driver , neo4j-ogm , oci-java-sdk , olingo-odata4 , openai-java , opencensus-java , openstack4j , orc , org.apache.groovy:groovy-all , org.apache.jena:jena-tdb , org.apache.parquet:parquet-cli , org.kitesdk:kite-data-hbase , org.ops4j.pax.exam , org.tachyonproject:tachyon-client , parquet-java , pinecone-java-client , pravega , protostream , pulsar , pulsar-client-reactive , quarkus , redisson , remoting-jmx , rescu , rest-assured , resteasy , resteasy-spring , retrofit , ribbon , scribejava , server-metrics , signalfx-java , simulacron , smallrye-mutiny-vertx-bindings , smallrye-open-api , socketlabs-java , spectator , strimzi-kafka-operator , swagger-core , swagger-parser , testcontainers-java , tika , tinkerpop , trendrrnsqclient , trino , twilio-java , typesense-java , vert.x , vertx-auth , vertx-kafka-client , vertx-web , wavefront-internal-reporter-java , web3j , web3j-quorum , wiremock , ws-wss4j , xchange , ycsb , zendesk-java-client , zjsonpatch , zookeeper
- Affected packages:
- json-schema-core @ 1.2.5 (+27934 more)