HackPath Academy

Advanced Offensive Security

Insecure Deserialization

Abuse object deserialization to tamper with logic or achieve RCE.

Advanced · 15 min

Open the interactive lesson →

Apps serialize objects to store or transmit them, then deserialize them back. If untrusted data is deserialized, an attacker can craft a malicious object that changes application logic or, with the right 'gadget chain', executes code on the server.

// Vulnerable: attacker controls the serialized blob
$obj = unserialize($_COOKIE['data']);
// A crafted object can trigger a magic method that runs code on destruct.

Take the quiz →