Tips

Insecure deserialization tips

Insecure deserialization turns untrusted serialized data back into objects, which can run code through gadget chains in the application’s libraries. Java, .NET, PHP, Python and Ruby all have known chains.

Published tips, newest first. Payloads and commands are shown as plain text.

  • Verify vulnerable components

    When reviewing a target's application, look for version metadata that can be compared with public advisories. Check if the deployed version falls within the affected range and verify the impact by checking the feature as it would be used normally. Then, review the source code to…

    Insecure deserializationDiscovery

Insecure deserialization: how to hunt it

Where to look

  • Serialized data in cookies, hidden fields and APIs: base64 starting with rO0 (Java) or AAEAAAD (.NET), and O: in PHP.
  • ViewState without a MAC or signed with a leaked machine key, and Java endpoints that accept serialized objects.
  • Libraries with public gadget chains among the dependencies you can identify.
  • YAML, pickle and other formats read with unsafe loaders.

What proves it

Use a gadget that triggers a DNS callback or a harmless command, and stop there.

Read further

Writeups on Insecure deserialization, by hunters and researchers, most with a short summary.

Related classes