Insecure Deserialization

Insecure Deserialization

Knowledge Base>Insecure Deserialization

Summary

Insecure Deserialization allows an attacker to execute arbitrary code via deserialization of untrusted data.

Testing methodology

AC ED , rO0, x-java-serialized-object, AAEAAAD/////Validate with PayloadIdentify Existence of ViewStateMAC Signature MissingGenerate ViewState PayloadMAC ExistsXXE, LFR to Retrieve KeyBrute Force KeyGenerate ViewState PayloadIdentify Risky Functionsunserialize()xstream, ObjectInputStream with readObject, SerializableTypeNameHandling, JavaScriptTypeResolverpickle/c_pickle/_pickle with load/loadsGenerate PayloadGenerate PayloadGenerate PayloadGenerate Payload
Blackbox
Whitebox
ViewState Exists
Serialized Object Detected
MAC Not Enabled
MAC Enabled
Key Retrievable
Insecure Deserialization
RCE
PHP
Java
.NET
Python

Description

Insecure Deserialization is a vulnerability that allows an attacker to execute arbitrary code by manipulating serialized data.

Attackers can abuse Insecure Deserialization to take full remote control over the application, steal sensitive data, or perform other malicious actions.

Remediations

  • Implement strict type constraints during deserialization. Only accept serialized objects that match expected object types.
  • Where possible, use safe alternatives to serialization. For example, if you only need to store simple data, consider using data formats that do not support serialization of arbitrary objects, such as
  • Allowlists are a great way of limiting what types of objects can be deserialized. Only objects that are on the allowlist will be allowed to be deserialized, making it far harder for an attacker to use
  • Sign serialized objects to ensure they haven't been tampered with during transport. Before deserializing an object, verify the signature to ensure the integrity of the data.

By using this site you agree to our Terms of Service and Privacy Policy.