Sep 30, 2026·6 min read·248 visits
An unauthenticated remote attacker can crash Java applications using Jackson-databind by transmitting JSON payloads with high-cardinality, unrecognized polymorphic type IDs, causing unbounded memory retention and JVM heap exhaustion.
CVE-2026-91776 is a high-severity Denial of Service (DoS) vulnerability in the FasterXML jackson-databind library. The vulnerability is caused by uncontrolled resource consumption (CWE-400) where raw, unrecognized polymorphic type IDs are cached indefinitely without boundaries inside TypeDeserializerBase. When name-based polymorphic deserialization is configured with a fallback mechanism (such as a default implementation or custom problem handlers), remote attackers can send crafted payloads containing unique unknown type IDs, causing heap exhaustion, Garbage Collection (GC) overhead limit exhaustion, and an Out-of-Memory (OOM) crash.
The FasterXML jackson-databind library provides powerful polymorphic type resolution mechanisms, allowing developers to dynamically map input fields to Java objects based on a type identifier. A typical implementation involves decorating target classes with @JsonTypeInfo(use = Id.NAME), instructing the deserializer to interpret a specific JSON property (such as type) as the class indicator. To optimize performance and bypass expensive reflection-based class lookups on every request, jackson-databind maintains an internal cache of resolved type deserializers within the TypeDeserializerBase class.
However, a design vulnerability exists in how the library caches unknown type IDs when fallback configurations are active. If the deserializer is configured with a default implementation (via defaultImpl = ...) or utilizes a custom DeserializationProblemHandler to gracefully handle unknown types, the lookup mechanism resolves any unrecognized type string to that fallback deserializer. The vulnerability arises because the library caches this mapping using the raw, attacker-supplied, unknown type string as the unique key within a long-lived, unbounded map.
Because the underlying cache map (_deserializers) is bound to the lifetime of the ObjectMapper instance—which is almost universally registered as an application-wide singleton—any memory retained by the map remains occupied indefinitely. Remote, unauthenticated attackers can exploit this behavior by sending a stream of payloads, each featuring a newly generated, unique, or exceptionally long unrecognized type identifier. This results in direct, monotonic memory consumption on the JVM heap.
The root cause of CVE-2026-91776 lies within the polymorphic type resolution implementation of com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase. When processing name-based polymorphic structures, the library relies on the internal method _findDeserializer(DeserializationContext ctxt, String typeId) to retrieve the appropriate deserializer for the given typeId string. The cache of resolved type-to-deserializer mappings is stored in the local map declared as:
protected final Map<String, JsonDeserializer<Object>> _deserializers;
When a request contains an unrecognized typeId, and a fallback implementation is defined, the lookup logic maps this invalid ID to the fallback deserializer (e.g., NullifyingDeserializer or the user-defined defaultImpl class). In vulnerable versions, the method executes _deserializers.put(typeId, deser); without validating the size of the _deserializers map or checking the length of the typeId key.
Because this cache lacks an entry-count ceiling and has no key-length restriction, the application fails to control resource consumption (CWE-400). A malicious actor can force the storage of an infinite number of unique string keys in the cache, with each key pointing to the same fallback deserializer object. Since the keys are unique strings, they represent newly allocated memory that cannot be reclaimed by garbage collection, guaranteeing eventual exhaustion of the JVM heap space.
The official fix, introduced in commit 2870d1d6dc1b7e1c07ee11dd5b04ab71cddbb577, implements bounds and structural restrictions to neutralize cache-exhaustion techniques.
// Vulnerable logic in TypeDeserializerBase.java directly stored the key:
_deserializers.put(typeId, deser);The patch introduces two defensive constraints (MAX_CACHED_TYPE_IDS and MAX_CACHED_TYPE_ID_LENGTH) to regulate the caching behavior of _deserializers:
// Hard-caps added in patched version:
final static int MAX_CACHED_TYPE_IDS = 1000;
final static int MAX_CACHED_TYPE_ID_LENGTH = 256;In addition to these limits, the patch inserts validation checks before putting new entries into the cache:
// Guard conditions to limit cache expansion
if (typeId.length() > MAX_CACHED_TYPE_ID_LENGTH) {
return deser; // Resolve but do not cache excessively long keys
}
if (_deserializers.size() >= MAX_CACHED_TYPE_IDS) {
_deserializers.clear(); // Flush cache if it exceeds size limits
}
_deserializers.put(typeId, deser);Furthermore, the patch modifies _findDeserializer to prevent caching instances of NullifyingDeserializer.instance and other transient deserialization fallbacks resolved via problem handlers. This ensures that transient, context-specific deserialization results do not corrupt or saturate the common cache. If an attacker tries to flood the system with randomized type IDs, the map will safely purge itself once it reaches 1,000 keys, limiting memory usage.
An attack against CVE-2026-91776 requires three conditions: polymorphic name-based deserialization is active, a default/fallback implementation is declared, and the parsing engine uses a singleton mapper.
The following architectural sequence illustrates how an attacker exploits the unbounded cache inside the JVM heap:
To execute the attack, the adversary transmits HTTP requests containing JSON bodies with randomized string keys. An example attack vector targeting a hypothetical Animal endpoint is structured as follows:
{ "animal": { "type": "exploit_key_9bc4a89d1", "name": "Rover" } }
{ "animal": { "type": "exploit_key_0ef72b4c2", "name": "Rover" } }With each request, the cache is populated with a unique key. Because the heap footprint grows with each request, an automated script sending thousands of requests per second can quickly exhaust the memory allocated to the JVM. Once the heap is full, performance degrades as garbage collection threads consume CPU cycles in vain, leading to an eventual application crash.
The primary impact of CVE-2026-91776 is an unauthenticated, remote denial of service (DoS) on the target host. Because name-based polymorphic parsing is heavily utilized in microservice architectures and RESTful web interfaces, endpoints processing structured JSON inputs are highly exposed.
When exploitation occurs, the physical memory allocated to the JVM is filled with uncollectible references. This forces the JVM Garbage Collector into a loop of aggressive collection sweeps, leading to high CPU usage and thread starvation. Legitimate user requests are delayed, timed out, or dropped.
Once the Garbage Collector cannot reclaim enough space to fulfill new object allocations, the JVM throws a fatal java.lang.OutOfMemoryError: Java heap space and crashes. In containerized environments, such as Kubernetes, this crash triggers container restarts. If the attack continues, it can result in a permanent outage of the target microservice, causing cascading failures across upstream components.
The recommended mitigation is to upgrade jackson-databind to a patched release. For environments where immediate patching is not possible, developers can implement several workarounds to reduce risk.
One workaround is to avoid using catch-all fallback classes or default implementations (defaultImpl) in name-based polymorphic mappings. By omitting default implementations, the parser fails immediately when encountering an invalid type ID, preventing cache allocation.
Another option is to implement a strict, custom TypeIdResolver to validate incoming type ID strings against a static list of allowed classes before resolution. This stops unknown inputs from entering the resolution pipeline. In addition, security teams can configure web application firewalls (WAF) to detect and block JSON payloads where polymorphic type fields exceed standard lengths (e.g., more than 256 characters).
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
jackson-databind FasterXML | >= 2.0.0, <= 2.18.10 | 2.18.11 |
jackson-databind FasterXML | >= 2.19.0, <= 2.21.6 | 2.21.7 |
jackson-databind FasterXML | >= 2.22.0, <= 2.22.2 | 2.22.3 |
jackson-databind FasterXML | >= 3.0.0, <= 3.1.6 | 3.1.7 |
jackson-databind FasterXML | >= 3.2.0, <= 3.2.2 | 3.2.3 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-400 |
| Attack Vector | Network |
| CVSS Severity | 7.5 (High) |
| Exploit Status | Proof-of-Concept Available |
| KEV Status | Not Listed |
| Vulnerability Class | Uncontrolled Resource Consumption |
The application does not adequately control the allocation and maintenance of a limited resource, enabling an actor to cause a denial of service.
CVE-2026-126298 (also tracked as GHSA-r53h-rw34-8h97) is an algorithmic complexity Denial of Service (DoS) vulnerability in the Natural Language Toolkit (NLTK) Python library affecting all versions prior to 3.10.4. The vulnerability resides in the nltk.tree.transforms.chomsky_normal_form function and its corresponding public method Tree.chomsky_normal_form(). When transforming a parse tree into Chomsky Normal Form using the default right-factoring strategy, the function repeatedly invokes list.pop(0) inside a loop iterating over all children of a node. In CPython, removing the initial element of a standard list requires an O(N) memory shift operation, causing the overall binarization algorithm to degrade to O(N^2) quadratic time complexity relative to the width of a node. Furthermore, converting horizontal node width into vertical tree depth bypasses initial parsing depth bounds, triggering subsequent stack exhaustion (RecursionError) when recursive methods traverse the mutated structure. Unauthenticated remote attackers who can submit bracketed tree strings to applications invoking this transformation can exhaust single-threaded CPU resources or induce unhandled application exceptions.
An algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) before version 3.10.4 allows remote unauthenticated attackers to cause a denial of service via crafted Combinatory Categorial Grammar (CCG) lexicon strings. The parser in nltk.ccg.lexicon.fromstring performs repeated immutable string slicing, concatenation, and regex tail capturing, resulting in O(n^2) CPU consumption when processing wide, flat category definitions.
CVE-2026-126295 (also tracked as GHSA-fg9w-wfp5-j933) is a path confinement bypass vulnerability in the Natural Language Toolkit (NLTK) affecting versions 3.10.0 prior to 3.10.4. The flaw resides in nltk/parse/bllip.py within the BllipParser class and its factory method BllipParser.from_unified_model_dir(). Unlike sibling tool wrappers in NLTK that enforce data-root confinement via the nltk.pathsec module, BllipParser passes caller-supplied filesystem paths directly into the third-party bllipparser native C extension without validation. When an application passes untrusted input as model paths or directories to BllipParser, an attacker can force the native extension to open arbitrary files on the local filesystem. This leads to information disclosure through parser diagnostic oracles, local model tampering via shared directories, and denial of service by hanging worker threads on blocking special files (such as FIFOs or device nodes) or exhausting memory via oversized files.
CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.
The Natural Language Toolkit (NLTK) versions 3.6 through 3.10.3 contain an algorithmic complexity vulnerability in the LegalitySyllableTokenizer.tokenize method. When processing tokens composed of continuous runs of vowels, an unguarded string reversal and set membership lookup loop executes in quadratic time relative to the input token length. Remote attackers capable of submitting arbitrary text to applications utilizing this tokenizer can trigger sustained single-core CPU exhaustion and application-level denial of service.
CVE-2026-126304 is a symlink path traversal vulnerability (CWE-59) in the Natural Language Toolkit (NLTK) versions 3.10.0 prior to 3.10.4. The YCOECorpusReader class constructs internal sub-readers for the 'psd' and 'pos' subdirectories using FileSystemPathPointer.join(), which relies exclusively on lexical string-prefix validation rather than canonical path resolution. An attacker who supplies a crafted YCOE corpus containing symbolic links in place of the 'psd' or 'pos' subdirectories can bypass directory confinement and read arbitrary files from sibling corpora or sensitive directories within the NLTK data sandbox.