用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ersinkoc/security-check --skill sc-deserialization命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | sc-deserialization |
| description | Insecure deserialization detection across all serialization formats and languages |
| license | MIT |
| metadata | {"author":"ersinkoc","category":"security","version":"1.0.0"} |
Detects insecure deserialization vulnerabilities where untrusted data is deserialized using formats that support object instantiation, enabling remote code execution, denial of service, or authentication bypass. Covers Python pickle, Java ObjectInputStream, PHP unserialize, .NET BinaryFormatter, Ruby Marshal, Node.js serialize, and unsafe YAML/XML deserialization.
Called by sc-orchestrator during Phase 2. Runs against all detected languages.
# Python
"pickle.loads(", "pickle.load(", "cPickle", "shelve.open(",
"yaml.load(", "yaml.unsafe_load(", "marshal.loads(",
"dill.loads(", "jsonpickle.decode("
# Java
"ObjectInputStream", "readObject(", "readUnshared(",
"XMLDecoder", "XStream", "Fastjson", "JSON.parseObject(",
"ObjectMapper.*enableDefaultTyping", "JsonTypeInfo",
"Hessian", "Burlap", "Kryo", "SnakeYAML"
# PHP
"unserialize(", "phar://", "maybe_unserialize(",
"S:.*:\"", "O:.*:\""
# C#/.NET
"BinaryFormatter", "SoapFormatter", "ObjectStateFormatter",
"NetDataContractSerializer", "LosFormatter",
"TypeNameHandling", "JsonConvert.*TypeNameHandling"
# Ruby
"Marshal.load(", "Marshal.restore(", "YAML.load(",
"Psych.load("
# Node.js
"node-serialize", "serialize", "funcster",
"cryo.parse(", "js-yaml.load("
Python — pickle RCE:
# VULNERABLE: Deserializing untrusted pickle data
import pickle
data = pickle.loads(request.body) # RCE via __reduce__
# SAFE: Use JSON for untrusted data
import json
data = json.loads(request.body)
Java — ObjectInputStream:
// VULNERABLE: Deserializing untrusted Java objects
ObjectInputStream ois = new ObjectInputStream(inputStream);
Object obj = ois.readObject(); // Gadget chains can execute code
// SAFE: Use allowlist-based deserialization filter (Java 9+)
ObjectInputFilter filter = ObjectInputFilter.Config.createFilter(
"com.myapp.models.*;!*"
);
ois.setObjectInputFilter(filter);
PHP — unserialize:
// VULNERABLE: Unserializing user input
$data = unserialize($_POST['data']); // POP chain via __wakeup, __destruct
// SAFE: Use JSON
$data = json_decode($_POST['data'], true);
// Or restrict allowed classes
$data = unserialize($input, ['allowed_classes' => ['SafeClass']]);
C# — BinaryFormatter:
// VULNERABLE: BinaryFormatter is ALWAYS dangerous with untrusted data
BinaryFormatter bf = new BinaryFormatter();
var obj = bf.Deserialize(stream); // RCE guaranteed with right payload
// SAFE: Use System.Text.Json
var obj = JsonSerializer.Deserialize<MyType>(jsonString);
YAML — unsafe load:
# VULNERABLE: yaml.load can instantiate Python objects
import yaml
data = yaml.load(user_input) # Can create arbitrary objects
# SAFE: yaml.safe_load only allows basic types
data = yaml.safe_load(user_input)
| Format | Risk Level | Notes |
|---|---|---|
| JSON (standard) | Safe | No code execution capability |
| XML (data only) | Safe | Unless combined with XXE |
| Protocol Buffers | Safe | Schema-defined, no arbitrary types |
| MessagePack | Safe | Data only |
| Python pickle | Dangerous | Arbitrary code execution via reduce |
| Java ObjectInputStream | Dangerous | Gadget chain exploitation |
| PHP unserialize | Dangerous | POP chain via magic methods |
| .NET BinaryFormatter | Dangerous | Microsoft deprecated it due to RCE |
| Ruby Marshal | Dangerous | Arbitrary object creation |
| YAML (full) | Dangerous | Can instantiate objects in most parsers |