This vulnerability occurs when an application accepts and processes serialized data from an untrusted source without proper validation, allowing an attacker to manipulate the data to execute malicious code or cause unexpected behavior.

Serialization is a common technique for converting complex objects into a storable or transmittable format, like JSON or binary streams. The danger arises when an application blindly trusts this serialized data from external sources—such as user inputs, cookies, or network packets—and reconstructs (deserializes) it back into live objects. Without strict controls, an attacker can craft malicious payloads that, when deserialized, trigger dangerous actions like remote code execution, file system access, or denial-of-service attacks. To prevent this, developers should treat all serialized data from outside the application's trust boundary as inherently hostile. Effective defenses include using safe, data-only serialization formats (like plain JSON without code execution features), implementing integrity checks with digital signatures, employing strict type constraints during deserialization, and utilizing security tools that monitor and validate deserialization processes. Never rely on obscurity or client-side checks, as attackers can easily bypass them.
Impact: Modify Application DataUnexpected State
Attackers can modify unexpected objects or data that was assumed to be safe from modification. Deserialized data or code could be modified without using the provided accessor functions, or unexpected functions could be invoked.
Impact: DoS: Resource Consumption (CPU)
If a function is making an assumption on when to terminate, based on a sentry in a string, it could easily never terminate.
Impact: Varies by Context
The consequences can vary widely, because it depends on which objects or methods are being deserialized, and how they are used. Making an assumption that the code in the deserialized object is valid is dangerous and can enable exploitation. One example is attackers using gadget chains to perform unauthorized actions, such as generating a shell.
Strategy: Firewall
Effectiveness: Moderate
javajavapythonMedium