/security-agent-skills:hunting-python-unsafe-deserializationfrom security-agent-skills
Hunts Python deserialization vulnerabilities where untrusted input reaches reconstructing loaders (pickle, unsafe YAML, marshal, dill, jsonpickle, numpy/pandas unpickling). Covers pickled data in requests, cookies, caches, queues, and model/dataframe files.
Ships in security-agent-skills. 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.
Several Python serialization formats are not data formats at all; they are programs. pickle invokes
__reduce__ during load, which names a callable and its arguments and runs them, so a pickled blob can
call any importable function on reconstruction. YAML's full loader instantiates arbitrary Python objects
from tags. marshal, dill, jsonpickle, and the model and dataframe loaders that wrap pickle inherit
the same property. The vulnerability is not a bug in these libraries; it is using them on data an
attacker controls. You find it by locating every loader that reconstructs objects rather than parsing
data, and asking whether untrusted bytes reach it.
Test deserialization only against services you own or are authorized to assess, on non-production data. A confirming payload runs code on load, so treat every proof as a live intrusion inside the authorized scope. If you can't name the authorization, stop.
Establish the reconstructing loaders first. Inventory every call that reconstructs objects rather
than parsing data: pickle.loads/load, yaml.load without a safe loader, marshal.loads, dill,
jsonpickle.decode, and model or dataframe loaders that unpickle internally. This is the false-positive
killer: a json.loads or a yaml.safe_load parses data and cannot construct arbitrary objects. Name
the reconstructing sinks first.
Trace untrusted bytes into each loader. Follow request bodies, cookies, headers, cache entries, queue messages, and uploaded or downloaded files into the loader. A model checkpoint or a dataframe pulled from an untrusted registry, a shared bucket, or a user upload is attacker-influenced the moment its provenance is not controlled. Confirm the bytes crossing the boundary are not internal-only.
Confirm the format supports construction, not just parsing. Pickle and unsafe YAML run a callable during load; safe YAML and JSON do not. For a wrapped loader, confirm it reaches pickle underneath. A loader restricted to a safe subset, a strict YAML loader, or a signed-and-verified blob changes the answer, so read the exact call.
Check any allowlist or unpickler restriction. A custom Unpickler that overrides find_class to
an allowlist, a safe YAML loader, or a signature check on the blob before load each blunt the vector.
The absence of any restriction means __reduce__ or a YAML tag can name any importable callable.
Determine whether a real restriction stands at the sink.
Trace the reconstruction to a callable. Confirm the format's construction step reaches an
attacker-chosen callable with attacker-chosen arguments: a __reduce__ naming a system call, a YAML
tag instantiating a class with a dangerous initializer, or a checkpoint whose custom reducer runs on
load. The callable is the terminal sink.
Confirm and record. Confirm by supplying a benign in-scope blob whose reduce or tag performs an out-of-band signal, proving the loader runs the callable, without a destructive payload. Kill the lead if no untrusted data reaches a reconstructing loader, if the loader is a safe data parser, if an unpickler allowlist or a verified signature constrains the blob, or if the format cannot construct objects. Record the source, the loader, the construction mechanism, and the callable.
__reduce__ runs a callable on load; there is no safe
way to unpickle untrusted data without an allowlisting unpickler.yaml.load without a safe loader instantiates objects. A YAML tag constructs arbitrary Python
classes; only safe_load or a safe loader parses data alone.Confirm. A worker loads task payloads from a shared cache with
pickle.loadsand no unpickler restriction. An attacker who can write a cache key supplies a pickle whose__reduce__names a callable that performs an out-of-band request. A benign marker payload confirms the callable runs on load. Confirmed untrusted deserialization to remote code execution,critical, remediation = replace the pickle transport with a data-only format such as JSON or a schema codec, and if pickle is unavoidable, load through anUnpicklerwhosefind_classallowlists only the expected classes.Kill. The service loads task payloads only with
json.loadsand loads YAML config only withyaml.safe_load; the one model file it reads is fetched from a controlled registry over an integrity check and loaded through an allowlisting unpickler. No untrusted blob reaches a reconstructing loader. Killed,kill_reason= "untrusted inputs parsed as data only (json, safe_load); the sole pickle load is integrity-verified and allowlist-restricted, so no attacker callable runs on load."
yaml.load without a safe loader instantiates arbitrary
objects; only safe_load parses data. Check which one.__reduce__ and YAML construction already executed. Post-load
validation is too late.You need every reconstructing loader, the untrusted inputs that reach each, the exact loader variant (reconstructing versus data-only), and any unpickler allowlist or pre-load signature check. For each loader, ask whether attacker bytes arrive, whether the format constructs objects, and whether a restriction stands between. Reading the loader call shows the intent; a benign out-of-band proof shows the callable actually runs.
hunting-java-deserialization-gadget-chains - the JVM sibling; both run code on reconstruction, one via
gadgets, one via __reduce__.auditing-ml-model-supply-chain - model and checkpoint files are a primary untrusted source here; that
skill governs where the artifact comes from.testing-rag-and-memory-poisoning - another path by which an untrusted artifact enters an AI pipeline and
is later loaded.adjudicating-taint-paths - use it to confirm untrusted bytes reach a reconstructing loader through
wrappers and framework indirection.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub unboundcompute/security-agent-skills --plugin security-agent-skills194 skills in this plugin
/adjudicating-dependency-cve-reachabilityDecide whether a CVE in a dependency actually exposes your application before you scramble to patch: is the vulnerable function on a real call path from your code, do the trigger preconditions hold, and can an attacker control the input that reaches it. Use when an advisory, SCA scan, or dependency bot flags a CVE and you must separate a genuine exposure from unreachable noise, or justify why you are or are not affected. Covers pinning the vulnerable symbol, call-path reachability, precondition checks, and taint from your entry points./adjudicating-taint-pathsDecide whether a whitebox lead is a real bug by tracing taint from an untrusted source to a dangerous sink and confirming every hop against live source. Use after a scanner, a candidate list, or your own reading surfaces a "this looks dangerous" sink (SQL exec, system/exec, file open, deserialize, template render, redirect target, memcpy) and you must decide whether attacker- controlled input actually reaches it - or kill the lead with evidence. Covers forward and reverse taint, witness paths, sanitizer analysis, and the evidence rules that separate a finding from a false positive.Other plugins' skills for the same job