In-depth lesson · technique
Unsafe deserialisation
What every disclosed Unsafe deserialisation report in the index teaches, put together: how it works, how it changed year by year, where it turns up, and things to try. Every point shows the reports it is seen in.
- disclosed reports read
- 1,147
- reports cited in this lesson
- 170
- median public bounty
- $1,500
Learning Server-side injection, step 8
Overview
What it is and why programs pay for it.
Unsafe deserialisation is the mistake of turning untrusted data back into live objects without restricting which classes can be created. The evidence covers many languages and formats: PHP unserialise, Ruby Marshal and YAML load, Java object streams and SnakeYAML, Python YAML load, and others. When a program rebuilds objects from input an attacker controls, the attacker can often choose the class and its properties, and that choice can steer the program into running code or reaching sensitive functions. This is why it matters: it frequently ends in remote code execution, but the reports also show lesser outcomes such as account takeover, token leaks, file deletion and SSRF.
The reports show it turning up in web frameworks and their plugins, in configuration and import flows, in signed cookies and session handling, in message queues and RPC endpoints, in enterprise products and in thick client applications. Examples include WordPress plugins, Laravel and Symfony packages, Rails cookie and Active Storage handling, JBoss and WebLogic endpoints, ColdFusion, SharePoint and Exchange, and Android apps. The common thread is a feature that accepts structured data from a user or a peer and rebuilds objects from it.
The database behind this lesson is small relative to the number of reports: 176 reports, 18 with a summary and 21 paid. So the evidence is a sample, not a complete picture, and the tips below stay close to what those reports actually describe.
Seen in these reports14
-
$1,500 High -
$500 -
$1,000 Medium
Show 5 moreShow fewer
-
$500 -
$250 Low -
-
Medium
How it works
The mechanics, as the reports show them.
The basic mechanism is that a serialisation format can carry more than plain values. It can name a class and set its fields. A safe parser only produces strings, numbers, lists and maps. An unsafe one will instantiate whatever class the data names. The reports show this in several forms: a YAML parser passing tagged values to unserialise, a YAML loader that instantiates arbitrary Python objects, and a JSON parser with default typing that lets a property name any class.
Once the attacker can choose the class, the next step is a gadget chain: a sequence of classes whose normal methods, run during or after deserialisation, end up calling something dangerous. The reports describe chains built from WordPress core classes, from Laravel and from a Symfony package, and a universal Ruby chain tested against YAML load sinks. The chain does not need a single obviously dangerous function; it needs a path from object creation to a useful side effect.
Several reports show the entry point being something that looks harmless. A signed cookie is trusted because it is signed, but if the signing secret leaks, the attacker can sign a serialised object and the app will deserialise it. Rails message verifiers and encryptors default to the Marshal serializer, so signed values become live Ruby objects. A committed session secret made exactly this possible in one report.
Other reports show indirect routes. A JSON key can become a method on a Ruby object, letting the attacker override methods the Redis client relies on. A JAAS login module can be pointed at an attacker LDAP server and the response is deserialised without validation. A template engine can expose serializer objects to a JavaScript engine, letting attacker JSON influence type handling. In each case the deserialisation is a step inside a larger flow rather than an obvious endpoint.
What makes it possible is usually a default or a convenience. A library defaults to an unsafe loader, a framework defaults to Marshal, a parser enables default typing, or a developer uses the unsafe variant of a load function. The reports repeatedly contrast the safe option with the one that was used: safe constructor versus plain instantiation, safe load versus unsafe load, an allowed-classes list versus none.
Seen in these reports14
-
$1,500 High -
$250 Low -
$33,510 Critical
Show 5 moreShow fewer
-
$5,000 Critical -
$3,000 Critical -
$1,000 Medium -
$500 -
$500
Year by year
11 yearsWhat each year's disclosed reports show, newest first. A year with few reports says less.
| 2001 | 29 |
|---|---|
| 2009 | 1 |
| 2011 | 1 |
| 2013 | 7 |
| 2014 | 1 |
| 2015 | 8 |
| 2016 | 14 |
| 2017 | 29 |
| 2018 | 23 |
| 2019 | 42 |
| 2020 | 137 |
| 2021 | 60 |
| 2022 | 59 |
| 2023 | 68 |
| 2024 | 88 |
| 2025 | 184 |
| 2026 | 238 |
-
2026
New this year2
- Testing the HPLC precision analysis tool for insecure deserialisation first appears in the disclosed reports.
- Crafting a JSON response that the template engine passes to the JavaScript engine to build a JSON serializer with unsafe type handling is a new technique in the disclosed reports.
Turned up less1
- Testing Sitecore for deserialisation of an object leading to code execution, seen in 2025, is not repeated in the 2026 disclosed reports.
-
2025
New this year1
- Testing Sitecore for deserialisation of an object leading to code execution as in CVE-27218 is newly noted in the disclosed reports.
Turned up less3
- Identifying and exploiting unsafe deserialisation sinks in Ruby code, seen in 2024, is rarer in the 2025 disclosed reports.
- Testing ColdFusion for pre-authentication JNDI injection and deserialisation code execution, common in 2024, is less prominent in the 2025 disclosed reports.
Reports from 20251
-
Critical
-
2024
New this year3
- Looking for Bundler responses that are Marshal loaded and crafting a malicious response first appears in the disclosed reports.
- Supplying a repository containing a crafted .rdoc_options file and seeing whether running rdoc deserialises objects from it is a new technique in the disclosed reports.
- Testing R's deserialisation handling as in CVE-2024-27322 is newly noted in the disclosed reports.
Kept working6
- Identifying and exploiting unsafe deserialisation sinks in Ruby code worked in the disclosed reports.
- Testing ColdFusion for pre-authentication JNDI injection and deserialisation code execution was effective in the disclosed reports.
Turned up less3
- From 2023 many reports are dedicated to finding and publishing gadget chains in common frameworks such as WordPress, Laravel and Symfony bundles, but this is rarer in the 2024 disclosed reports.
- Abusing Inductive Automation Ignition's custom deserialisation to compromise two hosts at once, common in 2023, is not repeated in the 2024 disclosed reports.
Earlier years8
Where it is found
1The features and places the reports found it in, most-reported first.
-
Perl 5.8 deserialisation handling is a place where this issue can appear.
Seen in 1 report
Technologies in these reports16
Root causes
11The mistakes in the code or configuration behind the reports.
-
SnakeYAML was instantiated without a SafeConstructor, allowing arbitrary Java object construction from untrusted YAML.
Seen in 2 reports
-
The YAML parser passes tagged values to unserialize, so the documented safety of the yaml_parse family does not hold.
Seen in 1 report
-
The session secret was committed to a public repository and the app used CookieStore with unsafe deserialisation of cookie data.
Seen in 1 report
-
Checksum parsing used YAML.load instead of a safe loader, and the resulting objects allowed a chain to Marshal.load on attacker data.
Seen in 1 report
-
$1,500 Critical
-
-
MessageVerifier and MessageEncryptor default to the Marshal serializer, so signed values deserialise into live Ruby objects.
Things to try
The most-reported tests in the largest contexts. Tick what you have tried; ticks stay in this browser and carry over to the full checklist. Test only what a program's scope allows.
ticked in this lesson
Java deserialisation endpoints
of 3 ticked-
Seen in 1 report
-
Seen in 1 report
YAML loaders and class instantiation
of 3 ticked-
Seen in 2 reports
-
Seen in 1 report
Payouts
27 paidPublic bounties in US dollars, from the data. 27 of 1,147 reports show an amount.
- a quarter paid up to
- $750
- median
- $1,500
- three quarters paid up to
- $4,999
- highest
- $90k
One in ten paid reports was paid $20k or more.
| Severity | Reports | Paid | Median | Highest |
|---|---|---|---|---|
| Critical | 183 | 4 | $4,000 | $34k |
| High | 418 | 4 | $4,760 | $20k |
| Medium | 53 | 3 | $1,000 | $1,000 |
| Low | 4 | 1 | $250 | $250 |
| Informational | 1 | 0 | None paid | None |
| Unrated | 488 | 15 | $1,000 | $90k |
Highest-paid reports5
-
$90,000 -
$33,510 Critical -
$20,000
-
$20,000 High -
$7,000
Tips for beginners
13Advice for a first hunt, drawn from the reports.
-
For PHP, build or find a gadget chain in the framework in use. The reports show chains in WordPress core, Laravel and a Symfony package, and phar deserialisation triggered through file operations such as logging settings or an importer. If you can trigger a file operation on a phar, you may not need a direct unserialise call.
Seen in 5 reports
-
Start with the language and framework defaults. If the target is Ruby on Rails, look at signed cookies, message verifiers and cache fetches that use the raw option. If it is Java, look at YAML parsing and JSON default typing. If it is PHP, look at unserialise calls and the yaml_parse family. Knowing the default unsafe path saves time.
Seen in 4 reports
-
Search for the unsafe variant of a load function in code you can read, and check whether the input is user controlled. The reports name several: YAML load instead of a safe loader, PyYAML unsafe load instead of safe load, SnakeYAML without a safe constructor, and unserialise without an allowed-classes list.
Seen in 4 reports
-
Look at import and configuration flows. A CSV importer, a config file, a repository containing a crafted options file, or a checksum file parsed during an upload are all places where structured data is rebuilt into objects. These are often overlooked because they are not obvious API endpoints.
Seen in 4 reports
-
For Java targets, probe known servlet and RPC endpoints rather than guessing. The reports mention JBoss JMXInvokerServlet and EJBInvokerServlet, WebSphere SOAP endpoints, JMeter RMI and Dubbo consumers. These are established surfaces where deserialisation is expected.
Seen in 4 reports
Guides and techniques
The best explainers, cheat sheets and technique posts on Unsafe deserialisation, from around the web.
-
PHP Filters Chain: What Is It And How To Use ItExplains how to chain PHP filter primitives to escalate file inclusion into remote code execution, with a Laravel gadget chain example.
Technique synacktiv.com
-
Exploiting Deserialisation in ASP.NET via ViewStateExplains forging ASP.NET ViewState to achieve deserialisation code execution when MAC validation is disabled or keys leak.
Technique soroush.me
-
Python pitfalls: Turning developer mistakes into vulnerabilitiesDetails exploitable Python pitfalls in os.path.join, urljoin and class pollution, with payloads leading to traversal and RCE.
Technique yeswehack.com
-
Danger of Stealing Auto Generated .NET Machine KeysExplains how to recover auto generated ASP.NET machine keys after compromise to keep code execution via ViewState.
Technique soroush.me
-
Java Exploitation Restrictions in Modern JDK TimesExplains why common Java deserialization gadgets fail on modern JDKs and outlines alternative code execution paths for red teams.
Technique codewhitesec.blogspot.com
Keep learning
Where this lesson fits, and what to read next.
Learning paths
The whole class
Related techniques
How this is made: our model read every listed Unsafe deserialisation report in the index (our own summary where we have one, otherwise the title and the platform's label), listed the patterns, and merged them. Each point was kept only if the reports it cites exist, are listed and belong here; payouts are computed from the data, not written by the model. Read the originals before relying on a point. Generated 26 Nov 2026 from 176 reports. All Unsafe deserialisation reports.