Insecure Deserialization
Insecure deserialization is a security flaw that occurs when an application converts data from a stored or transmitted format back into an object without properly checking whether that data has been tampered with. An attacker can exploit this by crafting malicious data that, when processed by the application, can lead to unauthorized actions such as executing harmful code or manipulating application logic. It was notably listed in the OWASP Top 10 as a significant web application risk.
Insecure deserialization is a vulnerability class that arises when user-controllable or otherwise untrusted data is passed to an application's deserialization routines without adequate validation, integrity checks, or type constraints. By manipulating serialized objects, an attacker can abuse the application's deserialization logic to achieve outcomes including, but not limited to, remote code execution, injection attacks, privilege escalation, and replay attacks. The severity depends on the deserialization library in use, the available gadget chains within the application's classpath or runtime environment, and whether the application enforces allowlists on deserializable types. This vulnerability typically affects languages and frameworks that support native object serialization (such as Java, PHP, Python, and .NET) and may be difficult to detect through static analysis alone, since exploitability often depends on the presence of specific classes and libraries available at runtime.
Why it matters
Insecure deserialization is significant because, in the worst case, it can enable remote code execution (RCE), giving an attacker the ability to run arbitrary commands on the server with the same privileges as the application. Even when RCE is not achievable, exploitation may still lead to privilege escalation, injection attacks, replay attacks, or manipulation of application logic. The severity of a given instance depends on the deserialization library in use, the gadget chains available in the application's classpath or runtime environment, and whether any allowlists constrain the types that can be deserialized. This combination of high impact and context-dependent exploitability makes it a particularly dangerous and often underestimated vulnerability class.
The risk was recognized prominently when insecure deserialization was included in the OWASP Top 10 as a significant web application security risk. It typically affects languages and frameworks that support native object serialization, such as Java, PHP, Python, and .NET. Because exploitability often hinges on runtime conditions (the presence of specific classes and libraries), the vulnerability may be difficult to detect through static analysis alone. This means organizations relying solely on code-level scanning may have a blind spot for deserialization risks, making defense-in-depth strategies and runtime protections especially important.
Who it's relevant to
Inside Insecure Deserialization
Common questions
Answers to the questions practitioners most commonly ask about Insecure Deserialization.