appsec.fyi

Deserialization — A Practical Guide

A curated AppSec resource library covering XSS, SQLi, SSRF, IDOR, RCE, XXE, OSINT, and more.

Deserialization: A Practical Guide

Curated and synthesized by . Last updated 2026-11-01. Synthesized from 107 of 107 curated resources. Browse all 107 Deserialization resources →

Problem Framing

Deserialization is a fundamental process in modern application development, enabling data persistence, network communication, and inter-process communication. However, when an application deserializes untrusted data without proper validation, it opens a significant attack surface, potentially leading to severe security vulnerabilities including remote code execution (RCE), denial of service (DoS), and privilege escalation [1][2][3][4]. The OWASP Top 10 has consistently highlighted insecure deserialization as a critical security risk for years [1][5][3][6].

The core of the problem lies in the deserialization process's ability to reconstruct complex objects and, in many cases, automatically invoke methods or code during this reconstruction. When an attacker can control the serialized input, they can craft malicious payloads that, when deserialized, trigger unintended code execution or state manipulation. This is often referred to as "object injection" [1][7][6]. The danger is amplified by the fact that many programming languages and libraries offer native serialization mechanisms that are convenient but inherently insecure when handling untrusted input [8][2][5][3].

This guide focuses on the practical aspects of understanding, identifying, and mitigating deserialization vulnerabilities for application security practitioners.

Core Mechanics

Serialization is the process of converting an object's state into a format (like a byte stream or string) that can be stored or transmitted [9][10][8][5][4]. Deserialization is the reverse: reconstructing an object from this data format [9][10][8][5][4]. The vulnerability arises when the deserialization process occurs without validating the origin or integrity of the input data. If an attacker can control the serialized data, they can influence the object graph being reconstructed [1][5][6].

Different programming languages and libraries have distinct serialization formats and mechanisms:

The fundamental attack pattern involves the attacker providing serialized data that, upon deserialization, causes the application to:

Notable Techniques

Attackers leverage various techniques to exploit deserialization vulnerabilities. These often revolve around identifying and chaining together existing code fragments (gadgets) within the application's libraries or the runtime environment to achieve a malicious outcome.

Gadget Chains

A deserialization gadget chain is a sequence of method invocations on existing, legitimate objects that, when triggered during deserialization, lead to arbitrary code execution or other harmful actions [50][52][13][14][15][5][53][6]. The core idea is to manipulate the deserialized object graph such that specific methods are called in a sequence that results in the desired malicious outcome.

Specific Exploitation Vectors

Detection & Prevention

Effectively defending against deserialization vulnerabilities requires a multi-layered approach, focusing on eliminating untrusted input where possible and implementing robust validation and control mechanisms.

Prevention Strategies

Detection Methods

Tooling

Several tools can aid in the discovery and exploitation of deserialization vulnerabilities:

Recent Developments

The landscape of deserialization vulnerabilities continues to evolve, with new research highlighting ongoing challenges and emerging attack vectors:

Where to Go Deeper

For those seeking to deepen their understanding and practical skills in deserialization security, the following resources are invaluable:

Sources cited in this guide

  1. Prevent insecure deserialization attacks (Veracode) — docs.veracode.com
  2. Insecure Deserialization in Web Applications — invicti.com
  3. Insecure Deserialization | OWASP — owasp.org
  4. Introduction to Deserialization Attacks — owlhacku.com
  5. Insecure Deserialization: The Vulnerability That Gives Attackers RCE — aquilax.ai
  6. Insecure deserialization | Web Security Academy — portswigger.net
  7. What is PHP Object Injection? An In-Depth Guide — jetpack.com
  8. OWASP Deserialization Cheat Sheet — cheatsheetseries.owasp.org
  9. Depickling, Gadgets, and Chains: The Exploit That Unraveled Equifax — brandur.org
  10. Deserialization Attacks: How Exploiting Data Formats Can Break Security — firecompass.com
  11. Gleipner: A Benchmark for Gadget Chain Detection in Java Deserialization Vulnerabilities — dl.acm.org
  12. Exploiting deserialization in recent Java versions (OWASP Stuttgart) — owasp.org
  13. Java Deserialization Gadget Chains Explained — klogixsecurity.com
  14. ysoserial: Java Deserialization Payload Generator — github.com
  15. Deserialization Vulnerabilities in Java — baeldung.com
  16. Java Deserialization Cheat Sheet — github.com
  17. Analyzing Prerequisites of Known Deserialization Vulnerabilities on Java Applications — dl.acm.org
  18. PayloadsAllTheThings - Java Deserialization Payloads — github.com
  19. SOUR PICKLE: Insecure Deserialization with Python Pickle — medium.com
  20. PayloadsAllTheThings: Insecure Deserialization Python — github.com
  21. Breaking Pickle: RCE Through Python Deserialization — medium.com
  22. Pickle Deserialization in ML Pipelines: The RCE That Won't Go Away — afine.com
  23. Reversing Pickles with r2pickledec — blog.doyensec.com
  24. Docling RCE via PyYAML (CVE-2026-24009) — oligo.security
  25. picoCTF Super Serial Writeup: PHP Object Injection Explained Clearly — medium.com
  26. PayloadsAllTheThings - PHP Deserialization Payloads — github.com
  27. Exploiting PHP Deserialization with POP Chains — medium.com
  28. PHP Object Injection Research — sonarsource.com
  29. Exploiting Insecure Deserialization Vulnerabilities | PortSwigger — portswigger.net
  30. How to Exploit PHAR Deserialization Vulnerability — pentest-tools.com
  31. CVE-2025-24813 PoC: Apache Tomcat Java Deserialization — github.com
  32. PayloadsAllTheThings: Insecure Deserialization DotNET — github.com
  33. Basic .Net deserialization ObjectDataProvider gadget (HackTricks) — book.hacktricks.xyz
  34. Deep Dive into .NET ViewState Deserialization — swapneildash.medium.com
  35. ysoserial.net: Deserialization Payload Generator for .NET — github.com
  36. .NET Deserialization Cheat Sheet — github.com
  37. CVE-2025-34153: Hyland OnBase RCE via Deserialization — sentinelone.com
  38. ViewState Deserialization Zero-Day in Sitecore (CVE-2025-53690) — cloud.google.com
  39. SharePoint Zero-Day CVE-2025-53770 Actively Exploited — blog.checkpoint.com
  40. GHSL-2026-200: Untrusted Seroval payloads — securitylab.github.com
  41. Security Advisory: Critical RCE Vulnerabilities in React Server Components (CVE-2025-55182) — snyk.io
  42. Ruby Marshal Kick-off Gadgets - elttam — elttam.com
  43. Ruby 4.0 Universal RCE Deserialization Gadget Chain - elttam — elttam.com
  44. PayloadsAllTheThings - Ruby Deserialization Payloads — github.com
  45. Ruby Vulnerabilities: Exploiting Open, Send, and Deserialization — bishopfox.com
  46. Marshal Madness: A Brief History of Ruby Deserialization Exploits — blog.trailofbits.com
  47. Unsafe Deserialization in Ruby | SecureFlag — knowledge-base.secureflag.com
  48. Lab: Exploiting Ruby Deserialization Using a Documented Gadget Chain | PortSwigger — portswigger.net
  49. Ruby 2.x Universal RCE Deserialization Gadget Chain | elttam — elttam.com
  50. Precise and Effective Gadget Chain Mining through Deserialization-Guided Call Graph Construction (USENIX Security 2025) — usenix.org
  51. Exploiting Apache Struts: Writing Better Detections (Gigamon) — blog.gigamon.com
  52. Deserialization Gadget Chain Definition — pentesterlab.com
  53. Now You Serial, Now You Don't — Systematically Hunting for Deserialization Exploits | Google Cloud — cloud.google.com
  54. Jackson deserialization vulnerability exploit (3 gadgets, GitHub) — github.com
  55. CVE-2026-25769: Wazuh Critical RCE via Unsafe Deserialization — resecurity.com
  56. SnakeYAML Deserialization Deep Dive (CVE-2022-1471) — greynoise.io
  57. Insecure Deserialization: Risks, Examples, and Best Practices — promon.io
  58. Gradle: deserialization of untrusted Java objects before authentication — github.com
  59. Master Key Included: Detecting SolarWinds ARM CVE-2026-28326 — bishopfox.com
  60. Broccoli2Shell: Brotli decoder RCE in Node.js, Python and more — broccoli2shell.com
  61. .NET JSON.NET Deserialization RCE — invicti.com
  62. Insecure DeserializationWeb ChallengesPart 1 — medium.com
  63. Insecure Deserialization Explained with Examples — thehackerish.com
  64. The Anatomy of Deserialization Attacks — cobalt.io
  65. WSUS Deserialization Exploit in the Wild (CVE-2025-59287) — research.eye.security
  66. Implant Encryption via the Dump Encoding Library — ipurple.team
  67. The Art of Hide and Seek: Pickle-Based Model Supply Chain Poisoning — arxiv.org
  68. PyTorch Users at Risk: 3 Zero-Day PickleScan Vulnerabilities — jfrog.com
  69. Exposing 4 Critical Vulnerabilities in Python Picklescan — sonatype.com
  70. Leaking internal headers in Flask Ninja with deserialization — eval.blog
  71. Automated Discovery of Deserialization Gadget Chains (Black Hat) — i.blackhat.com
  72. BinaryFormatter Deserialization Security Guide for .NET — learn.microsoft.com
  73. ZDI-26-816 Ultralytics load_dataset_cache_file deserialization RCE — zerodayinitiative.com
  74. Xoscar unauthenticated RCE through actor message deserialization — github.com
  75. Serena RCE via insecure pickle deserialization of LSP symbol cache — github.com
  76. I Found a $90k Remote Code Execution Vulnerability in Google — simonkoeck.com
  77. From Padding Oracle to Shell: Unauthenticated RCE in Telerik UI for ASP.NET AJAX — tantosec.com
  78. IBM webMethods Integration CVE-2025-36072: Deserialization RCE — zeropath.com
  79. Cisco ISE Insecure Java Deserialization — Cisco Docs — cisco.com
  80. Cisco ISE Insecure Java Deserialization (CVE-2025-20124) — sec.cloudapps.cisco.com
  81. CVE-2026-33439: OpenAM Pre-Auth RCE via Deserialization — advisories.gitlab.com
  82. DELMIA Apriso Insecure Deserialization Exploited in the Wild (CVE-2025-5086) — sonicwall.com
  83. Deserialization Bugs in the Wild — medium.com
  84. CVE-2025-12305: Shiyi-blog RCE via Deserialization — sentinelone.com
  85. CVE-2025-42928: SAP jConnect RCE via Deserialization — sentinelone.com
  86. Friday the 13th JSON Attacks (Black Hat) — blackhat.com
  87. Deserialization Gadget Chains in Android: An In-Depth Study — arxiv.org
  88. An In-depth Study of Java Deserialization RCE Exploits — dl.acm.org
📚 This guide is synthesized from the full text of resources curated in the Deserialization library, and refreshed as new material is added.