Cookies Notice
This site uses cookies to deliver services and to analyze traffic.
📣 Apiiro named a Leader in the 2026 Gartner® Magic Quadrant™ for Software Supply Chain Security
Insecure deserialization is a vulnerability that occurs when an application deserializes untrusted data without validating it, allowing an attacker to manipulate the resulting object. Serialization converts an object into a storable or transmittable format, and deserialization rebuilds it. When the input is attacker-controlled, the rebuilt object can carry malicious state or trigger unintended code paths during reconstruction.
This flaw is dangerous because it can lead to remote code execution, one of the most severe outcomes among application security vulnerabilities. It held a place in the OWASP Top 10 for years and remains a high-impact issue in any system that accepts serialized objects from external sources, such as APIs, message queues, and session tokens.
A deserialization vulnerability is exploited by feeding the application a crafted serialized payload that the deserializer processes as trusted input. The attack succeeds when reconstruction triggers behavior the developer never intended.
During deserialization, many languages automatically invoke methods on the object being rebuilt. An attacker chains together classes already present in the application or its dependencies so that the act of deserializing executes a sequence of calls ending in a dangerous operation.
This often results in a code execution vulnerability, where the attacker runs arbitrary commands on the server. Because the malicious logic uses legitimate classes, the payload can slip past filters that only inspect surface-level input. This class of bug is uniquely dangerous because the vulnerability lives in the act of reconstruction itself, so parsing the input is enough to trigger it, with no further action required from the application. The same technique can also enable denial of service, authentication bypass, and data tampering depending on the available classes.
Deserialization flaws appear across many ecosystems, but some are more exposed because their native serialization mechanisms invoke object methods automatically.
The common thread is that each mechanism reconstructs objects in a way that can invoke code, which is what makes untrusted input so dangerous.
A deserialization exploit has been at the root of several large breaches, usually because a public-facing endpoint accepted serialized data.
High-profile incidents have involved Java applications exposing serialized objects over HTTP, where attackers used gadget chains from widely used libraries to achieve remote code execution. The pattern recurs because serialized data often travels through trusted-looking channels, including cookies, API payloads, and inter-service messages, so it bypasses scrutiny that raw user input would receive.
These flaws are also hard to spot in review, since the vulnerable line is often a single innocuous-looking deserialize call far from where the data enters the system. The framing in insecure deserialization OWASP guidance reflects this: the danger comes from assuming incoming objects are safe, whatever serialization format is in use. Strong vulnerability prioritization helps teams focus on deserialization points that are actually reachable from untrusted input, which is where exploitation happens.
Prevention starts with a simple principle: never deserialize data from an untrusted source if you can avoid it. When you must, constrain what can be reconstructed.
Effective controls include using data-only formats like JSON with strict schemas instead of native object serialization, applying allowlists that restrict which classes may be deserialized, and running deserialization in low-privilege contexts. Integrity checks such as signing serialized data prevent tampering in transit. Detecting these flaws early with static application security testing helps surface unsafe deserialization calls during development, before they reach a reachable endpoint.
Runtime monitoring adds a second layer, flagging unexpected object types or class-loading behavior that can signal an attempt in progress. Keeping dependencies patched also matters, because many exploits rely on gadget chains in outdated libraries.
Java, Python, PHP, .NET, and Ruby are frequently affected because their native serialization can invoke object methods or execute code during reconstruction. Java is the most widely documented target.
No. Exploitability depends on whether the deserialization point processes untrusted input and whether usable gadget chains exist. Many flagged instances handle trusted data and are not practically exploitable.
Deserializing attacker-controlled data can trigger chained method calls that end in arbitrary command execution. This makes remote code execution the most severe and most common impact of the vulnerability.
A gadget chain is a sequence of existing classes whose methods, when invoked during deserialization, combine to perform a malicious action such as running a command. Attackers assemble them from available libraries.
Validation alone is limited, since malicious payloads use legitimate classes. Stronger measures include allowlisting permitted classes, using data-only formats, and signing serialized data to confirm integrity before any deserialization occurs.
Recognized by leading analysts
Apiiro is named a leader in ASPM by IDC, Gartner, and Frost & Sullivan. See what sets us apart in action.