In-depth Mining of Java Deserialization Gadget Chain via Bottom-up Gadget Search and Dataflow Aided Payload Construction
This talk presents JDD, an automated tool for discovering Java deserialization gadget chains by combining fragment-based summary analysis with a bottom-up search approach. It addresses the state explosion problem inherent in traditional top-down static analysis by modeling gadget relationships as an Injection Object Construct Diagram (IOCD). The research demonstrates how to generate complex, multi-stage payloads that bypass existing blacklists and identifies 127 zero-day gadget chains in popular Java applications. The tool is released as an open-source project to assist security researchers in vulnerability discovery.
Breaking Java Deserialization: How JDD Automates Gadget Chain Discovery
TLDR: Java deserialization remains a critical attack vector, but manual gadget chain discovery is notoriously slow and prone to state explosion. The new JDD tool automates this process by using a bottom-up search approach and an Injection Object Construct Diagram (IOCD) to model complex dependencies. This research successfully identified 127 zero-day gadget chains in popular Java applications, proving that even well-defended systems often harbor hidden, exploitable paths.
Java deserialization vulnerabilities are the gift that keeps on giving for attackers. While the industry has spent years patching high-profile targets like CVE-2021-44228, the underlying issue—the inherent danger of reconstructing objects from untrusted data—persists across the entire ecosystem. Most security researchers rely on manual analysis or existing tools like ysoserial to find gadget chains. However, these methods struggle when faced with modern, complex Java applications where the path from a source to a sink is buried under layers of abstraction and conditional logic.
The core problem with traditional static analysis for deserialization is state explosion. When you attempt to trace a gadget chain from a source (like an entry point in a library) to a sink (like Runtime.exec), the number of potential paths grows exponentially. Most tools simply time out or produce an unmanageable number of false positives.
The JDD Approach: Bottom-Up Discovery
JDD changes the game by flipping the script. Instead of starting at the source and trying to find a path to a sink, it works backward from the sink using a fragment-based summary. By breaking the application down into smaller, manageable fragments, JDD can identify which gadgets are actually reachable and how they link together.
This bottom-up approach is significantly more efficient. It models the relationships between gadgets as an Injection Object Construct Diagram (IOCD). This diagram acts as a map, tracking not just the code flow, but the specific constraints required to trigger each gadget. If a gadget requires a specific field to be set or a certain condition to be met, the IOCD captures that dependency.
For a pentester, this is a massive upgrade. Instead of spending days manually mapping out class hierarchies and trying to figure out why a payload isn't triggering, you can use JDD to generate a valid injection object that satisfies the necessary constraints.
Navigating Complex Dependencies
One of the most impressive aspects of this research is how it handles the "complex object field relations" that often break traditional fuzzers. In many real-world scenarios, a gadget chain isn't just a linear sequence of calls. It involves parallel objects and nested dependencies.
Consider a scenario where you need to trigger a HashMap.put call to reach an equals method. If the HashMap requires specific keys and values that are themselves complex objects, a standard fuzzer will fail to generate a valid payload. JDD uses static taint analysis to identify these dependencies and then uses a constraint solver to generate the appropriate values.
When you are on an engagement, this means you can target deeper, more obscure parts of the application. If you find a potential sink, you don't need to manually craft the entire object graph. You can let the tool handle the heavy lifting of satisfying the constraints required to reach that sink.
Real-World Impact and Bypassing Blacklists
The researchers behind JDD didn't just build a tool; they used it to find 127 zero-day gadget chains in popular Java applications. This is a staggering number, and it highlights a fundamental truth about A06:2021-Vulnerable and Outdated Components: even if you think your dependencies are secure, the way they interact can create new, unforeseen vulnerabilities.
Many of these chains were found because they bypassed existing blacklists. Developers often try to secure deserialization by blocking known dangerous classes. However, JDD shows that attackers can often find alternative paths—different gadgets that achieve the same result—that aren't on the blacklist. For example, the researchers demonstrated how replacing certain fragments in a known chain allowed them to create a new, functional exploit for Apache Fury and other protocols.
Defensive Reality
Defending against these attacks is notoriously difficult. If your application relies on Java serialization, you are fighting an uphill battle. The most effective defense is to stop using native Java serialization entirely. Move to safer data exchange formats like JSON or Protobuf, and ensure you are using strict schema validation.
If you absolutely must use serialization, you need to implement a robust allowlist that only permits the specific classes your application requires. Blacklisting is a losing game; as this research demonstrates, there is almost always another gadget chain waiting to be discovered.
For those of you performing assessments, start by auditing the serialization entry points in your target applications. If you find a library that supports multiple protocols, check if it is using a default configuration that might be vulnerable. Use JDD to map out the potential gadget chains and see if you can reach any interesting sinks. The goal is to find the path of least resistance, and with 127 new chains identified, the odds are in your favor.
The landscape of Java security is shifting. As tools like JDD become more accessible, the barrier to entry for finding complex deserialization vulnerabilities is dropping. If you aren't already looking for these chains, you are missing a massive part of the attack surface.
Vulnerability Classes
Tools Used
Attack Techniques
OWASP Categories
Up Next From This Conference
Similar Talks

Kill List: Hacking an Assassination Site on the Dark Web

Firewalls Under Fire: China's Ongoing Campaign to Compromise Network Protection Devices




