Insecure Deserialization
A route through the library rather than a dump of it. Items are drawn from the full Deser collection, filtered to teaching material (news items are excluded) and ordered within each stage by depth signals — whether the piece carries code, how substantial it is, and what readers actually open.
1
Start here
5 resourcesOrientation and first principles — what the bug class is and how it behaves.
- The Anatomy of Deserialization AttacksReference detailing deserialization attack techniques across PHP, Python (using pickle), Node.js, Java, and .NET. It covers how vulnerabilities arise from processing untrusted serialized data, enabling attacks like Remote Code Execution (RCE), SQL injection, and path traversal through PHP magic methods (__wakeup(), __destruct()), Python's pickle module, and Java's ObjectInputStream. Detection tools like Ysoserial, Ysoserial.net, and various Burp plugins are mentioned, alongside remediation strategies focusing on using alternative data formats like JSON/XML and deserializing only signed data.
- Insecure Deserialization Tutorial and ExamplesTutorial on insecure deserialization, demonstrating attacks on a video game API by manipulating serialized Java objects. It covers understanding serialization, using tools like `jdeserialize` and `hexdump` to modify payloads, achieving state manipulation by changing item quantities, and ultimately performing remote code execution by leveraging gadget classes within Java frameworks. The tutorial emphasizes that relying on obscurity for security is ineffective and stresses the importance of robust input validation.
- OWASP Deserialization Cheat SheetReference for safely deserializing untrusted data, this OWASP cheat sheet details vulnerabilities and mitigation techniques across PHP, Python, and Java. It covers identifying insecure usage of functions like `unserialize()` and `pickle.loads()`, and advises on hardening Java's `ObjectInputStream` through subclassing or agents, mentioning libraries like SerialKiller and NibbleSec. The guide emphasizes using safe interchange formats like JSON and protecting sensitive data by declaring fields as `transient`.
- Insecure Deserialization Explained with ExamplesLibrary for learning about and exploiting insecure deserialization vulnerabilities. It provides detailed explanations and code examples for PHP object injection (including Phar deserialization), Python pickle deserialization, and Java deserialization. The library covers vulnerability definitions, impact, real-world CVE examples, exploitation techniques using custom code, and mitigation strategies, with exercises in OWASP WebGoat and real-world bug bounty report analysis.
- Introduction to Deserialization AttacksWalkthrough of deserialization attacks, covering serialization basics in Python with `pickle` and PHP with `serialize`. It details how untrusted input during deserialization can lead to critical vulnerabilities like remote code execution (RCE) by loading unexpected classes or executing dangerous code paths. The entry includes a Python Flask application demonstration showcasing the process and the associated risks.
2
Build depth
5 resourcesReal testing methodology, tooling, and writeups that show the work.
- Ruby Vulnerabilities: Exploiting Open, Send, and DeserializationLibrary for exploiting common Ruby-specific remote code execution vulnerabilities, including insecure use of the `open` function, malicious `send` or `public_send` calls, and binary deserialization gadget chains. It provides a walkthrough and a vulnerable Ruby on Rails application to demonstrate exploitation techniques found during an assessment.
- ysoserial.net: Deserialization Payload Generator for .NETTool for generating .NET deserialization payloads, inspired by ysoserial. ysoserial.net provides gadget chains from common .NET libraries to exploit unsafe deserialization, wrapping user-specified commands within these chains. It supports various gadget types like ActivitySurrogateDisableTypeCheck, AxHostState, and DataSet, and works with multiple formatters including BinaryFormatter, Json.NET, and SoapFormatter, enabling remote DLL loading and arbitrary code execution when vulnerable applications deserialize malicious data.
- Marshal Madness: A Brief History of Ruby Deserialization ExploitsLibrary detailing the historical evolution of Ruby Marshal deserialization exploits, from early bug tracker issues by Charlie Somerville Hailey to modern industrialized gadget discovery techniques. It traces the decade-long cycle of patches and bypasses, highlighting contributions from researchers like joernchen, Luke Jahnke, and Alex Leahu, and discusses the ongoing challenges presented by these vulnerabilities, referencing CVEs from Java and PHP as comparative examples.
- PayloadsAllTheThings - PHP Deserialization PayloadsLibrary detailing PHP Object Injection, a vulnerability allowing code execution, SQL injection, and path traversal via improper sanitization of input to `unserialize()`. It covers exploiting magic methods like `__wakeup()` and `__destruct()`, using the `phar://` wrapper, and provides payloads for common frameworks, including examples generated by the `phpggc` tool. The resource also outlines how to identify vulnerable code by searching for `unserialize()` calls and relevant magic methods.
- Pickle Deserialization in ML Pipelines: The RCE That Won't Go AwayLibrary of Python tools and techniques for mitigating pickle deserialization vulnerabilities in ML pipelines. This library addresses the persistent RCE risk posed by `pickle.loads()`, which can execute arbitrary code during deserialization. It covers exploitation vectors including direct model file loading, supply chain attacks on platforms like HuggingFace, and emerging threats in LLM serving infrastructure such as CVE-2025-32444 in vLLM and CVE-2026-26220 in LightLLM, where untrusted data is deserialized over network sockets.
3
Go deep
8 resourcesNovel research, edge cases, and the techniques that push the class forward.
- Java Deserialization Tricks - SynacktivLibrary of techniques for evading WAFs and EDRs during Java deserialization exploitation. This library focuses on stealthy RCE, demonstrating how to bypass pattern detection by renaming packages and modifying gadget chains, as well as utilizing the Translet API to inject custom Java code at runtime. It provides methods to avoid detection from common security solutions like WAFs and EDRs by obfuscating strings and injecting bytecode, offering alternatives to direct command execution.
- Ruby 2.x Universal RCE Deserialization Gadget Chain | elttamLibrary for universal RCE deserialization in Ruby 2.x, detailing exploitation techniques. This resource describes how to achieve arbitrary command execution by discovering and chaining available gadgets from the standard library, overcoming limitations of previous methods that required specific gems like ActiveSupport and ERB. It covers identifying gadgets that can dynamically load other libraries, including those that partially control the `require` argument, to expand the attack surface and execute system commands.
- Now You Serial, Now You Don't — Systematically Hunting for Deserialization Exploits | Google CloudLibrary for hunting deserialization exploits, featuring tools like HeySerial.py for rule generation and CheckYoself.py for validation. This resource details the systematic research process used to develop these tools, enabling the detection of exploitation attempts against vulnerabilities in Exchange (CVE-2021-42321), Zoho ManageEngine (CVE-2020-10189), Jira (CVE-2020-36239), Telerik (CVE-2019-18935), Jenkins (CVE-2016-9299), and log4j (CVE-2021-44228), by identifying gadget chains and malicious payloads.
- The Art of Hide and Seek: Pickle-Based Model Supply Chain PoisoningLibrary for detecting and bypassing pickle-based model supply chain poisoning in Python AI/ML frameworks. It systematically discloses the poisoning surface across model loading paths and risky functions, identifying 22 overlooked loading paths and 133 exploitable gadgets. The research also introduces Exception-Oriented Programming (EOP) to bypass scanners, demonstrating robust vulnerabilities missed by current detection solutions like PickleScan and ModelScan, and leading to a $6000 bug bounty.
- Precise and Effective Gadget Chain Mining through Deserialization-Guided Call Graph Construction (USENIX Security 2025)Tool for precise gadget chain mining using deserialization-guided call graph construction. This approach addresses limitations of existing methods by incorporating controllability analysis, hybrid dispatch techniques, and recovery of missing call edges due to reflection. Evaluated on 30 applications, it demonstrated improved recall and precision, detecting numerous new gadget chains and previously unknown exploitation methods for vulnerabilities like those related to Java deserialization.
- Deserialization Gadget Chains in Android: An In-Depth StudyAnalysis of Java deserialization gadget chains in Android, using a novel detection tool to analyze the Android SDK and third-party libraries. The study found that the Android SDK contains trampoline gadgets similar to the Java Class Library and can trigger Java native serialization via the Parcel API. However, despite extensive testing, no security-critical gadget chains were discovered in the analyzed Android codebases, suggesting the problem is less prevalent than commonly assumed.
- Deep Dive into Fastjson Deserialization VulnerabilitiesDeep Dive into Fastjson Deserialization Vulnerabilities
- Gleipner: A Benchmark for Gadget Chain Detection in Java Deserialization VulnerabilitiesGleipner: A Benchmark for Gadget Chain Detection in Java Deserialization Vulnerabilities