
Deserialization Insecure
Map gadget-chain versions and magic-byte fingerprints when you are doing authorized deserialization testing on Java, .NET, Ruby, or polyglot services you ship.
Overview
Deserialization-insecure is an agent skill for the Ship phase that deep-dives Java gadget-chain compatibility, cross-language deserialization patterns, and magic-byte fingerprinting for authorized insecure-deserializatio
Install
npx skills add https://github.com/yaklang/hack-skills --skill deserialization-insecureWhat is this skill?
- CommonsCollections CC1–CC7 compatibility matrix with JDK constraints and execution types
- Recommended chain priority: CC6 → CC7 → CC5 for broadest JDK coverage
- CommonsBeanutils chain version ranges for classpath guessing
- SnakeYAML, Hessian, Kryo, .NET ViewState, and Ruby YAML exploitation patterns
- Deserialization fingerprint magic bytes for triage before chain selection
- CommonsCollections chains CC1–CC7 documented with version and JDK constraints
- Recommended exploitation order: CC6 → CC7 → CC5
Adoption & trust: 1.1k installs on skills.sh; 980 GitHub stars; 0/3 security scanners passed (skills.sh audits).
What problem does it solve?
You suspect unsafe deserialization but do not know which gadget chain, JDK build, or language-specific gadget fits the target classpath.
Who is it for?
Indie developers and consultants running scoped pentests or pre-launch reviews on Java/.NET/polyglot backends they are allowed to attack.
Skip if: Unauthorized targeting of third-party systems, or teams that only need high-level OWASP reminders without gadget-chain detail.
When should I use this skill?
You need Java gadget chain version compatibility, SnakeYAML/Hessian/Kryo patterns, .NET ViewState forgery details, Ruby YAML exploitation, or deserialization fingerprint magic bytes during authorized testing.
What do I get? / Deliverables
You get a version-aware chain matrix and language-specific exploitation patterns so authorized tests target the right library and transport instead of blind ysoserial guessing.
- Chain and library shortlist matched to classpath and JDK
- Fingerprint notes tying magic bytes to probable serializers
Recommended Skills
Journey fit
Unsafe deserialization is validated during pre-launch security review and regression checks on backends you control. Deep gadget-chain and cross-language patterns belong on the security shelf alongside ysoserial-style workflows, not general backend implementation.
How it compares
Reference depth for chain selection and fingerprints, not a one-click scanner or a secure-by-default serialization design guide.
Common Questions / FAQ
Who is deserialization-insecure for?
Solo builders and small security-minded teams doing authorized reviews on web APIs and services where serialized Java or cross-language payloads might appear.
When should I use deserialization-insecure?
During Ship security testing when you see Java stacks, YAML configs, Hessian/Kryo RPC, .NET ViewState, or ambiguous binary bodies and need chain version fit and magic-byte triage before exploitation attempts.
Is deserialization-insecure safe to install?
It is offensive-security reference material—use only with written authorization. Review the Security Audits panel on this Prism page and treat payloads as dangerous in any environment.
SKILL.md
READMESKILL.md - Deserialization Insecure
# Java Gadget Chains & Cross-Language Deserialization Deep Dive > **AI LOAD INSTRUCTION**: Load this when you need Java gadget chain version compatibility, SnakeYAML/Hessian/Kryo patterns, .NET ViewState forgery details, Ruby YAML exploitation, or deserialization fingerprint magic bytes. Assumes the main [SKILL.md](./SKILL.md) is already loaded for ysoserial basics, PHP/Python fundamentals. --- ## 1. JAVA GADGET CHAIN VERSION COMPATIBILITY MATRIX ### 1.1 CommonsCollections Chains | Chain | Library | Version Range | JDK Constraint | Execution Type | |---|---|---|---|---| | **CC1** | Commons Collections 3.x | 3.0–3.2.1 | JDK < 8u72 (InvokerTransformer filter) | `Runtime.exec()` | | **CC2** | Commons Collections 4.x | 4.0 | None (uses `TemplatesImpl`) | Bytecode execution | | **CC3** | Commons Collections 3.x | 3.0–3.2.1 | JDK < 8u72 | `TemplatesImpl` (bytecode) | | **CC4** | Commons Collections 4.x | 4.0 | None | `TemplatesImpl` | | **CC5** | Commons Collections 3.x | 3.0–3.2.1 | JDK ≥ 8 OK (no `InvokerTransformer` check needed) | `Runtime.exec()` via `TiedMapEntry` | | **CC6** | Commons Collections 3.x | 3.1–3.2.1 | All JDK versions | `Runtime.exec()` via `HashSet` trigger | | **CC7** | Commons Collections 3.x | 3.1–3.2.1 | All JDK versions | `Runtime.exec()` via `Hashtable` | **Recommended priority**: CC6 → CC7 → CC5 (broadest compatibility, no JDK version constraint). ### 1.2 CommonsBeanutils Chains | Chain | Library | Version Range | Notes | |---|---|---|---| | **CB1** | Commons BeanUtils 1.x + Commons Collections 3.x | BU 1.6.1–1.9.4, CC ≤ 3.2.1 | `PropertyUtils.getProperty` → `TemplatesImpl` | | **CB1 (no-CC)** | Commons BeanUtils 1.x only | BU 1.8.3–1.9.4 | Requires `commons-logging`; no CC dependency | ### 1.3 Spring Framework Chains | Chain | Library | Version Range | Notes | |---|---|---|---| | **Spring1** | Spring Core + Spring Beans | 4.1.4 (known), varies | `MethodInvokeTypeProvider` → `TemplatesImpl` | | **Spring2** | Spring Core | 4.1.4 | `ObjectFactoryDelegatingInvocationHandler` | ### 1.4 JDK-Only Chains (No External Dependencies) | Chain | JDK Version | Notes | |---|---|---| | **Jdk7u21** | JDK 7u21 | `AnnotationInvocationHandler` + `TemplatesImpl`; patched in 7u25 | | **JRMPClient** | All | Triggers JRMP call to attacker RMI server (not direct RCE, but enables chaining) | | **JRMPListener** | All | Opens RMI listener on victim (less useful) | | **URLDNS** | All | DNS-only; confirmation probe, no RCE | ### 1.5 Other Notable Chains | Chain | Library | Notes | |---|---|---| | **Groovy1** | Groovy 1.7–2.4 | `MethodClosure` + `ConvertedClosure` | | **Hibernate1** | Hibernate 5.x (with `javassist` or `cglib`) | `BasicLazyInitializer` → `TemplatesImpl` | | **Hibernate2** | Hibernate 5.x | Via `AbstractComponentTuplizer` | | **JBossInterceptors1** | JBoss Interceptors + weld-core | Rarely seen in modern apps | | **Myfaces1** | Apache MyFaces 1.x | `ViewState` deserialization | | **Myfaces2** | Apache MyFaces 2.x | `ViewState` deserialization | | **ROME** | ROME 1.0 | `ObjectBean` → `EqualsBean` → `ToStringBean` | | **Vaadin1** | Vaadin framework | `PropertysetItem` chain | | **Wicket1** | Apache Wicket | Requires specific classpath setup | | **C3P0** | C3P0 connection pool | `PoolBackedDataSource` → JNDI or URL classloading | | **Clojure** | Clojure runtime | `core$fn` → arbitrary function execution | | **BeanShell1** | BeanShell 2.x | `XThis` + `Interpreter.eval()` | | **Jython1** | Jython | `PyFunction` → arbitrary Python execution in JVM | | **MozillaRhino1/2** | Mozilla Rhino JS engine | `NativeJavaObject` chains | ### 1.6 Chain Selection Decision Tree ``` Identify target libraries (error messages, pom.xml, /META-INF/MANIFEST.MF): ├── Commons Collections 3.x on classpath? │ ├── JDK < 8u72 → CC1, CC3 │ └── JDK ≥ 8u72 → CC5, CC6, CC7 ├── Commons Collections 4.x? │ └── CC2, CC4 ├── Commons BeanUtils? │ └── CB1 (with or without CC) ├── Spring Framework? │ └── Spring1, Spring2 ├── Groovy? │