Serialization Security Review
Purpose
Find vulnerabilities caused by unsafe serialization, deserialization, object mapping, parser configuration,
and cross-boundary state transfer. Focus on cases where untrusted bytes, JSON, YAML, XML, cookies, view state,
cache blobs, or queue messages are turned into executable, privileged, or overly dynamic objects.
High-Risk Targets
Prioritize:
- Java native serialization and
ObjectInputStream
- Jackson polymorphic typing and unsafe default typing
- Fastjson auto-type behavior
- .NET
BinaryFormatter, LosFormatter, NetDataContractSerializer
- PHP
unserialize() and POP-chain entry points
- Python
pickle, marshal, and unsafe YAML loaders
- Node parsers that revive functions, prototypes, or constructors
- session cookies, view state, queue payloads, cache entries, and signed blobs crossing trust boundaries
Workflow
Step 1: Find Deserialization Boundaries
Locate where external or semi-trusted data is parsed, decoded, revived, or reconstructed:
- HTTP body parsers
- cookies and session stores
- file import handlers
- webhook processors
- message queue consumers
- cache/database blob readers
- mobile/app local state restores
Step 2: Classify the Input Trust Level
For each boundary, decide whether the input is:
- fully attacker-controlled
- user-controlled but signed/encrypted
- partner-controlled
- internal-only but reachable through weaker upstream systems
Do not assume "internal" means safe without an integrity guarantee.
Step 3: Identify Dangerous Parser Features
Look for:
- polymorphic type resolution
- class-name-based instantiation
- automatic object revival
- unsafe YAML/XML object construction
- magic methods, hooks, or callbacks triggered after deserialization
- prototype pollution or constructor abuse
- gadget-friendly libraries on the classpath or dependency tree
Step 4: Judge Exploitability
Confirm:
- the data crosses a trust boundary
- attacker influence reaches the parser
- type restrictions or integrity checks are absent, weak, or bypassable
- the resulting object graph has dangerous side effects or privileged behavior
Step 5: Recommend Safe Patterns
Prefer:
- explicit DTO binding
- strict schemas
- allowlisted concrete types
- data-only formats without executable behavior
- integrity validation before parsing
- safe parser defaults and feature disablement
Step 6: Report by Boundary
For each issue, state:
- boundary
- parser/serializer in use
- attacker control level
- impact
- exact hardening action
Guardrails
- Do not report plain serialization for output-only responses as a vulnerability by itself.
- Do not assume every JSON parser use is dangerous; focus on dynamic typing, unsafe features, and trust boundaries.
- Do not treat signed data as safe if the signing key is weak, leaked, or validation happens after parsing.
- Do not forget secondary entry points such as queues, caches, or admin import tools.
- Do not stop at
deserialize(); inspect post-deserialization hooks and object behavior.
Output Format
Use:
[SEVERITY] <serialization issue title>
Boundary: <entry point or state-transfer path>
File: <path>:<line>
Why it matters: <trust boundary + parser behavior + impact>
Fix: <concrete hardening action>
1---
2name: eresus-serialization-review
3description: >
4 Serialization and deserialization security review skill for object mappers, parser pipelines, message formats,
5 and state transfer mechanisms. Trigger when the user asks to: "review serialization security", "check deserialization",
6 "audit Jackson/Fastjson/YAML/XML parsing", "look for gadget-chain risk", "review session or message deserialization",
7 or wants a focused audit of parser-driven attack surface. Complements eresus-sast-scanner with a deep dive on serialization abuse paths.
8metadata:
9 source: https://skillmd.com/skills/aibot88/eresus-serialization-review
10 version: "1.0"
11 domain: application-security
12 mode: targeted-review
13---
14
15# Serialization Security Review
16
17## Purpose
18
19Find vulnerabilities caused by unsafe serialization, deserialization, object mapping, parser configuration,
20and cross-boundary state transfer. Focus on cases where untrusted bytes, JSON, YAML, XML, cookies, view state,
21cache blobs, or queue messages are turned into executable, privileged, or overly dynamic objects.
22
23## High-Risk Targets
24
25Prioritize:
26
27- Java native serialization and `ObjectInputStream`
28- Jackson polymorphic typing and unsafe default typing
29- Fastjson auto-type behavior
30- .NET `BinaryFormatter`, `LosFormatter`, `NetDataContractSerializer`
31- PHP `unserialize()` and POP-chain entry points
32- Python `pickle`, `marshal`, and unsafe YAML loaders
33- Node parsers that revive functions, prototypes, or constructors
34- session cookies, view state, queue payloads, cache entries, and signed blobs crossing trust boundaries
35
36---
37
38## Workflow
39
40### Step 1: Find Deserialization Boundaries
41
42Locate where external or semi-trusted data is parsed, decoded, revived, or reconstructed:
43
44- HTTP body parsers
45- cookies and session stores
46- file import handlers
47- webhook processors
48- message queue consumers
49- cache/database blob readers
50- mobile/app local state restores
51
52### Step 2: Classify the Input Trust Level
53
54For each boundary, decide whether the input is:
55
56- fully attacker-controlled
57- user-controlled but signed/encrypted
58- partner-controlled
59- internal-only but reachable through weaker upstream systems
60
61Do not assume "internal" means safe without an integrity guarantee.
62
63### Step 3: Identify Dangerous Parser Features
64
65Look for:
66
67- polymorphic type resolution
68- class-name-based instantiation
69- automatic object revival
70- unsafe YAML/XML object construction
71- magic methods, hooks, or callbacks triggered after deserialization
72- prototype pollution or constructor abuse
73- gadget-friendly libraries on the classpath or dependency tree
74
75### Step 4: Judge Exploitability
76
77Confirm:
78
79- the data crosses a trust boundary
80- attacker influence reaches the parser
81- type restrictions or integrity checks are absent, weak, or bypassable
82- the resulting object graph has dangerous side effects or privileged behavior
83
84### Step 5: Recommend Safe Patterns
85
86Prefer:
87
88- explicit DTO binding
89- strict schemas
90- allowlisted concrete types
91- data-only formats without executable behavior
92- integrity validation before parsing
93- safe parser defaults and feature disablement
94
95### Step 6: Report by Boundary
96
97For each issue, state:
98
99- boundary
100- parser/serializer in use
101- attacker control level
102- impact
103- exact hardening action
104
105---
106
107## Guardrails
108
109- Do not report plain serialization for output-only responses as a vulnerability by itself.
110- Do not assume every JSON parser use is dangerous; focus on dynamic typing, unsafe features, and trust boundaries.
111- Do not treat signed data as safe if the signing key is weak, leaked, or validation happens after parsing.
112- Do not forget secondary entry points such as queues, caches, or admin import tools.
113- Do not stop at `deserialize()`; inspect post-deserialization hooks and object behavior.
114
115---
116
117## Output Format
118
119Use:
120
121```markdown
122[SEVERITY] <serialization issue title>
123Boundary: <entry point or state-transfer path>
124File: <path>:<line>
125Why it matters: <trust boundary + parser behavior + impact>
126Fix: <concrete hardening action>
127```