Skip to main content
Serialization converts an object to a storable/transmittable format. Deserialization reconstructs it. Insecure deserialization allows attackers to manipulate serialized data to execute harmful code during object reconstruction.

PHP Deserialization

PHP magic methods called during deserialization:

PHP Object Injection Prevention

On PHP < 7.0, the allowed_classes option does NOT exist, making unserialize() inherently dangerous.

Tools

Python Deserialization

Pickle

When unpickling, __reduce__ is called:

YAML

Node.js Deserialization

node-serialize

Prototype Pollution

Abusing __proto__ and prototype to inject properties into the base object prototype, potentially affecting all objects in the application.

Java Deserialization

Fingerprinting

White Box Code Review

Exploitation with ysoserial

React Server Components (CVE-2025-55182)

The bound array directly populates server action parameters. If the action wraps exec(), this yields RCE.

.NET Deserialization

Fingerprinting

Look for TypeNameHandling, JavaScriptTypeResolver in code. In traffic, look for Base64 strings starting with AAEAAAD///// or JSON with $type or TypeObject.

ysoserial.net

JNDI Injection & Log4Shell

Log4j JNDI injection (CVE-2021-44228) allows RCE via specially crafted log messages:

Java Message Service (JMS) Attacks

JMET can attack JMS services by sending malicious serialized objects:

Prevention

Tools Summary

ysoserial

Java gadget chain payload generator.

PHPGGC

PHP gadget chain generator (ysoserial equivalent).

ysoserial.net

.NET deserialization exploit generator.

Burp Freddy

Burp extension for detecting deserialization in ObjectInputStream, JSON, and YAML.