Deserialization Attacks
Deserialization attacks occur when an application converts externally supplied data back into objects without adequately verifying that the data is safe or legitimate. An attacker can manipulate or inject malicious content into this process to abuse the application's logic. This may result in unauthorized code execution, privilege escalation, or other harmful outcomes.
Deserialization attacks exploit vulnerabilities that arise when untrusted or user-controllable serialized data is consumed by an application's deserialization process without sufficient validation or integrity checking. Because deserialization typically reconstructs objects by invoking application logic, an attacker who can manipulate the serialized payload may abuse existing class behaviors, inject malicious data, or trigger unintended code paths. Exploitation outcomes may include remote code execution, injection of malicious code or data analogous to SQL injection, and logic abuse, depending on the target language runtime, available classes, and how deserialized objects are subsequently used. The vulnerability class is distinct from purely static code flaws in that exploitability typically depends on runtime context, including which classes are available on the deserialization path and how the application processes the resulting objects.
Why it matters
Deserialization attacks represent one of the more severe vulnerability classes in modern application security because successful exploitation can yield remote code execution, privilege escalation, or deep injection of malicious data into application logic. Unlike many vulnerabilities that affect only a narrow layer of an application, deserialization flaws can affect any component that consumes externally supplied serialized data, including APIs, session mechanisms, message queues, and inter-service communication channels. This broad attack surface means that a single vulnerable deserialization endpoint can expose an entire application or backend system.
The nature of deserialization makes these vulnerabilities particularly difficult to address through surface-level controls. Because the application's own class library and runtime are typically leveraged during exploitation, attackers can often abuse legitimate code paths rather than injecting shellcode or foreign logic. This means that input filtering alone is generally insufficient as a defense, and that exploitability is highly dependent on runtime context, including which classes are loaded and how deserialized objects are subsequently consumed by the application.
The Apache Commons Collections gadget chain vulnerability, which was publicly detailed around 2015, demonstrated how widely deployed Java libraries could be chained together to achieve remote code execution through insecure deserialization in numerous enterprise products. That incident brought significant attention to how transitive dependencies and available class libraries expand the exploitability of deserialization vulnerabilities far beyond what application developers may anticipate. OWASP has recognized insecure deserialization as a critical risk category, reflecting the severity and prevalence of this vulnerability class across technology stacks.
Who it's relevant to
Inside Deserialization Attacks
Common questions
Answers to the questions practitioners most commonly ask about Deserialization Attacks.