/security-agent-skills:hunting-java-deserialization-gadget-chainsfrom security-agent-skills
Hunts Java deserialization vulnerabilities where untrusted byte streams reach readObject/ObjectInputStream with a gadget chain on the classpath. Covers native serialization, JNDI lookups, and framework endpoints over HTTP, queues, caches, or cookies.
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.
Java native serialization was never a trust boundary, but it is treated as one every time a service
accepts a serialized object from a client, a queue, a cache, or a cookie and calls readObject. The
danger is not the deserialization call by itself; it is the combination of that call with a gadget, an
already-present library class whose own readObject, readResolve, or finalizer performs a side effect
an attacker can steer. Chained together, ordinary library classes reconstruct into a sequence that ends
in a runtime command, a naming lookup, or a template evaluation. You find these by locating every place
untrusted bytes reach a deserializer and then asking which reachable library versions on the classpath
carry a chain that fires on reconstruction.
readObject, an ObjectInputStream, or a framework method that deserializes.Test deserialization only against services and applications you own or are authorized to assess, on non-production infrastructure. A confirming payload runs code on the target, so treat every proof as a live intrusion and stay inside the authorized scope. If you can't name the authorization, stop.
Establish the deserialization sinks first. Before chasing gadgets, inventory every call that turns
bytes into objects: ObjectInputStream.readObject, readUnshared, framework converters that accept a
serialized object, and any wrapper that hides one. This is the false-positive killer: a gadget on the
classpath is harmless if no untrusted stream ever reaches a deserializer. Name the sinks, then work
backward.
Trace untrusted bytes into each sink. Follow request bodies, headers, cookies, queue messages, cache entries, and uploaded files into the deserializer. A stream the service itself produced and never exposes is not a source; a stream any client, or any producer on a shared bus, can supply is. Confirm the bytes crossing the boundary are attacker-influenced, not merely internal.
Enumerate reachable gadget-bearing libraries. Read the dependency set and the effective versions after resolution. A gadget only fires if its class is on the runtime classpath at a vulnerable version; a fixed version or an absent library kills the chain. Match the present libraries against known property-oriented chains rather than assuming any deserializer is exploitable.
Confirm the chain fires on reconstruction. A usable gadget performs its side effect during
deserialization, in readObject, readResolve, a finalizer, or a lazily evaluated map or comparator,
not only when the application later uses the object. Read the gadget's reconstruction path and confirm
the attacker controls the value that reaches the terminal call, a runtime exec, a naming lookup, or a
template evaluation.
Check the defenses that actually stop it. A look-ahead filter or an allowlist of permitted classes
at the ObjectInputStream defeats most chains; a denylist of known-bad names does not, because a new
gadget sidesteps it. Determine whether the sink enforces a class allowlist, whether the format was
moved off native serialization entirely, and whether the reachable versions are patched.
Confirm and record. Confirm by delivering a benign, in-scope object that proves reconstruction reaches the terminal call, an out-of-band callback or a controlled side effect, without deploying a destructive payload. Kill the lead if no untrusted stream reaches a deserializer, if a class allowlist or look-ahead filter constrains reconstruction to safe types, or if every gadget-bearing library is at a patched version. Record the source, the sink, the specific chain, and the terminal call.
readObject on an untrusted stream
is the whole vulnerability; the surrounding code looks like ordinary object handling.Confirm. An internal service consumes task messages from a shared queue and calls
readObjecton each message body with no class filter. A reachable library version on the classpath carries a property-oriented chain whose comparator evaluates a template during reconstruction. A crafted message reconstructs into a chain that performs an out-of-band lookup, proving reachability to the terminal call. Confirmed untrusted deserialization to remote code execution,critical, remediation = install a look-ahead class allowlist at theObjectInputStreamlimited to the expected message types, and move the message format off native serialization to a data-only codec.Kill. The endpoint deserializes with a resolver that permits only three application message classes and rejects everything else, and the two gadget-bearing libraries are at patched versions. A crafted stream of any known chain is refused before reconstruction. Killed,
kill_reason= "class allowlist at the deserializer confines reconstruction to expected types and gadget libraries are patched; no attacker-supplied class reaches readObject."
You need every deserialization sink, the untrusted streams that reach each one, the resolved classpath with effective library versions, and the class-filtering defense at each sink if any. For each sink, ask whether attacker bytes arrive, whether a reachable gadget chain exists at a vulnerable version, and whether an allowlist stands between. Reading the sink and the gadget's reconstruction path shows the intent; a benign out-of-band proof shows the chain actually fires.
hunting-php-object-injection-pop-chains - the same property-oriented chain idea in PHP, where magic
methods stand in for readObject as the reconstruction trigger.hunting-dotnet-deserialization-type-injection - the .NET sibling, where an attacker-chosen type name
drives the chain rather than a native serialized stream.adjudicating-dependency-cve-reachability - use it to prove a gadget-bearing library version is
actually on the runtime classpath and reachable, not merely declared.adjudicating-taint-paths - use it to confirm untrusted bytes reach the deserializer 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./auditing-account-abstraction-and-paymaster-trustAudit an ERC-4337 account-abstraction deployment for trust misplaced in the user-operation lifecycle: a smart account whose validation accepts a signature or nonce it should reject, a paymaster that agrees to sponsor gas for operations it should not so an attacker drains its deposit, a bundler or entry-point assumption that lets a user operation be replayed or reordered for gain, and validation logic that reads mutable state or reaches outside its allowed scope. Covers smart-contract wallets, paymasters, bundlers, and the entry point in an account-abstraction stack where a user operation is validated and sponsored before it executes. Use when a user operation is validated, paid for, and executed by separate parties and that trust split is the boundary. The crafted user operation is the source, the drained paymaster or unauthorized execution is the sink, and the over-permissive validation or sponsorship rule is the bug./auditing-account-recovery-and-reset-trustAudit password reset and account recovery flows for the trust that lets an attacker take over an account: a reset token that is guessable, long-lived, reusable, or not bound to the account it was issued for, a recovery path that verifies a weaker factor than login and bypasses multi-factor, a reset link whose host comes from an attacker-controllable header so the token leaks, and a recovery that trusts an unverified email or phone change to redirect the reset. Covers the recovery surface of authentication systems, where resetting a credential or recovering access is the alternate door into an account. Use when an application offers password reset or account recovery and that flow is a path to authentication. The attacker-driven recovery request is the source, the account it takes over is the sink, and the weak token, bypassed factor, or leaked reset link that grants it is the bug./auditing-admission-control-policy-gapsAudit cluster admission control for gaps that let a non-compliant or hostile workload through: a validating webhook that fails open when its backend is unreachable, a policy that scopes by namespace or label and misses the namespaces that matter, a mutating webhook whose changes are trusted downstream, and an ordering or exemption that lets a privileged pod bypass the checks meant to stop it. Covers Kubernetes admission webhooks and policy engines that are supposed to enforce workload security at create and update time. Use when admission policies are the control that keeps privileged, unsigned, or over-permissioned workloads out of the cluster. The workload submitted for admission is the source, the admitted resource is the sink, and the policy gap that let it through is the bug./auditing-ai-agent-permissionsAudit what an AI agent is actually allowed to do versus what its task needs. Covers excessive agency (tools, scopes, and autonomy beyond the job), missing human-in-the-loop gates on irreversible actions, over-broad credentials and their blast radius, sandbox and code-interpreter escape, unfiltered egress, and unbounded resource or spend (denial-of-wallet). Use when granting an agent a tool or scope, reviewing an agent's permission posture, or deciding which actions need approval. The model's restraint is not a control; permissions are.Other plugins' skills for the same job