/security-agent-skills:testing-postmessage-and-web-message-trustfrom security-agent-skills
Tests cross-document messaging trust by auditing postMessage handlers for missing origin/source checks and wildcard targets. Use when reviewing client code that acts on message data.
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.
Cross-document messaging lets one browsing context send data to another, across origins, and the receiving page decides what to do with it. That decision is a trust boundary: the message arrives with an origin the browser stamps on it, but nothing forces the handler to check that origin, or to confirm the message came from the window it expected. A handler that reads the data straight into the page markup, an evaluation, a navigation, or storage, without an exact origin and source check, can be driven by any site that opens or frames the window. The mirror image is a page that posts sensitive data to another window with a wildcard target, spraying it to whatever origin happens to be there. The bug is trusting a message because it arrived, rather than because it came from a known origin and source. You find these by reading every message listener and every outbound post and asking who is allowed to send or receive.
Test cross-document messaging only against applications you own or are authorized to assess, from a test origin and test accounts, using benign markers to show a handler acts on an unexpected message or that a secret reaches a wildcard target. A confirmed case runs in a real user's session, so coordinate and stay in scope. If you can't name the authorization, stop.
Establish whether the handler checks the origin and source first. For each message listener, read whether it validates the event origin by exact match against an expected value, and, where relevant, confirms the source window is the one it expected, before using the data. This is the false-positive killer: a handler that acts only on an exact-origin, expected-source message cannot be driven by an arbitrary site, while one with a missing, wildcard, or substring origin check can. Name the check before judging the sink.
Map every listener and every outbound post. Inventory each registered message handler and what it does with the data, and each call that sends a message to another window along with the target origin it uses. These are the sources and sinks the rest of the loop examines.
Judge the origin check. A missing check accepts every origin; a substring or prefix check accepts a lookalike origin that contains the expected string; a check that compares against the wrong property, or only logs a mismatch without stopping, is no check. Only exact equality against a fixed expected origin is a real gate. Decide which the handler uses.
Follow the data into the sink. Determine whether the message data reaches a dangerous sink: written into the page markup or an element that executes it, passed to an evaluation, used as a navigation target, or stored where it is later trusted. A handler that reads only inert fields into non-executing state is low impact even without a perfect origin check; a handler that reaches an executing sink is the finding.
Check the outbound posts and the source window. For each send, confirm the target origin is an exact value and not a wildcard, because a wildcard delivers the data to whatever origin currently occupies the target window. For receivers, confirm the source-window check where the protocol expects a specific partner, so a third frame cannot impersonate it.
Confirm and record. Confirm by posting a benign marker from an unexpected test origin and observing the
handler reach its sink, or by showing a secret delivered to a wildcard target, on an isolated instance.
Kill the lead if the handler checks the origin by exact match and the source where relevant and only then
uses the data, if the data reaches no executing or trusted sink, or if every outbound post uses an exact
target origin. Record the handler or post, the trusted value, the sink, and the impact, or set a
kill_reason.
Confirm. A page registers a message handler that writes a field from the message data into an element that renders it as markup, with no origin check. A page on an attacker origin frames the target and posts a message whose field contains markup, and it executes in the victim's session on an isolated instance. Confirmed cross-document message handling to DOM scripting,
high, remediation = validate the event origin by exact match against the expected origin (and the source window where the partner is fixed) before using the data, and write the data through a safe, non-executing API rather than as markup.Kill. The same handler compares the event origin by exact equality against a single expected origin, confirms the source is the expected child window, and writes the data through a text API that does not execute markup, and every outbound post uses an exact target origin rather than a wildcard. A message from a test origin is ignored and never reaches the sink. Killed,
kill_reason= "handler acts only on an exact-origin, expected-source message and writes through a non-executing API, and outbound posts use exact targets; an arbitrary origin cannot drive the sink or receive the data."
You need every registered message listener with its origin and source checks and the sink each feeds, and every outbound post with the target origin it uses. For each listener, decide whether an arbitrary origin can drive a dangerous sink; for each post, whether a secret can reach a wildcard target. Reading the handler and its checks settles most leads; posting a benign marker from an unexpected test origin, or observing a secret delivered to a wildcard, on an isolated instance settles the rest.
testing-client-side-dom-vulnerabilities - the message data reaching an executing sink is a DOM sink that
skill covers in depth; this one focuses on the cross-window trust boundary that feeds it.auditing-cors-and-cross-origin-trust - the server-side mirror of the same origin-trust question, and it
also treats cross-window message handlers, so the two audits share the boundary.reviewing-content-security-policy - a strong policy limits what a driven handler can execute, so a weak
policy and a missing origin check compound.hunting-reflected-and-stored-xss - a message handler that writes data as markup is another route to the
script execution that skill hunts through server output.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