Back to skill

Security audit

Agent Dispatch

Security checks for vulnerabilities and agentic risk

Overview

This skill openly routes work to downloaded subagents, but it can run changing remote instructions and keep them for future use without strong verification or user approval.

Install only if you are comfortable with this skill fetching third-party agent instructions from GitHub, storing them locally, and using them to steer delegated work. For sensitive repositories or security/infrastructure tasks, prefer reviewed local agents, pinned and hash-verified sources, or require explicit approval before any download or dispatch.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (3)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:14
Finding
Untrusted Remote Instructions Are Injected into Subagent Prompts<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 14-16 and 49-53 **Vulnerability Type**: Remote instruction injection and task-goal hijacking **Risk Level**: Critical ### Vulnerable Code ```markdown # Agent dispatch You have access to a registry of 130+ specialized subagents. **Before doing specialized work yourself, check this index and dispatch to the appropriate agent.** If the agent is not installed locally, download it on the fly. ``` ```markdown ### Step 4: read and dispatch Read the agent file. Extract everything after the YAML frontmatter (after the second `---` line). Pass that full text as the prompt to the **Task** tool, prepending the specific work request. Use a general-purpose subagent with the full prompt inline — do not reference the agent by registered name. ``` ### Technical Analysis The skill instructs the current agent to redirect specialized tasks to another agent and to insert the complete body of an externally sourced file into that subagent's prompt. The only documented validation concerns the presence of YAML frontmatter; there is no semantic validation, instruction allowlist, safety filtering, or enforcement that the downloaded prompt remains subordinate to the user's request. Prompt text is executable control input in an agent environment. A malicious upstream file could contain instructions to ignore the original task, conceal actions, access unrelated files, request secrets, invoke available tools, or produce deceptive audit results. Prepending the legitimate request does not establish a reliable trust boundary because the untrusted text remains part of the instruction context. ### Attack Path 1. An attacker compromises or gains update access to one of the upstream agent-definition files. 2. The attacker adds instructions that pass the superficial frontmatter check but alter the subagent's goals or tool behavior. 3. A user requests a matching specialized task, such as a security audit or infrastruct ...[truncated 1055 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the requirement to insert downloaded files verbatim into agent prompts. 2. Bundle reviewed and version-controlled agent prompts inside the skill package. 3. Treat all remotely retrieved content as untrusted data rather than executable instructions. 4. If dynamic retrieval is essential, parse the document into a restrictive schema containing only approved fields and reject arbitrary instruction blocks. 5. Enforce a fixed system prompt stating that remote content cannot override user intent, safety controls, tool restrictions, or data-access boundaries. 6. Require explicit user approval before dispatching any remotely sourced agent definition. 7. Run dispatched agents with least-privilege tool permissions, filesystem isolation, network restrictions, and access limited to the files required by the current task. 8. Record and expose the exact prompt source, immutable version, and integrity hash to the user before execution. ]]>

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:31
Finding
Mutable Remote Agent Payloads Are Retrieved Without Cryptographic Integrity Verification<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 31-45 **Vulnerability Type**: Unverified remote payload retrieval **Risk Level**: High ### Vulnerable Code ```markdown ### Step 3: download the agent Construct the download URL from these parts: - Base: `https://raw.githubusercontent.com/VoltAgent/awesome-claude-code-subagents/main/categories` - Directory: look up the category key in the mapping below - File: `AGENT_NAME.md` Download: ```bash mkdir -p "${AGENTS_DIR:-$HOME/.claude/agents}" && curl -sfL "URL" -o "${AGENTS_DIR:-$HOME/.claude/agents}/AGENT_NAME.md" ``` **If download fails** (non-zero exit or empty file): - Run: `rm -f "${AGENTS_DIR:-$HOME/.claude/agents}/AGENT_NAME.md"` - Tell the user: "Could not download AGENT_NAME — handling this task directly." - Do the work yourself. Do not retry. **Validation**: if the downloaded file does not start with `---` (YAML frontmatter), treat it as corrupt, delete it, and handle the task yourself. ``` ### Technical Analysis The skill retrieves agent instructions from a mutable `main` branch and relies solely on HTTPS transport and a formatting check. It does not pin an immutable commit, verify a cryptographic hash or digital signature, or compare the content against a reviewed allowlist. Checking whether a file begins with YAML frontmatter confirms only its format. It does not establish the identity, provenance, integrity, or safety of its contents. Although the retrieved payload is Markdown rather than a native binary, the skill subsequently uses its body as executable agent instructions. Consequently, changes made after the skill has been reviewed can alter its effective behavior. ### Attack Path 1. An attacker compromises the upstream repository, a maintainer account, or another process capable of changing the referenced branch. 2. The attacker modifies a registered agent file while preserving valid YAML frontmatter. 3. A local request triggers a cache miss for that agent. 4. The ...[truncated 909 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Eliminate runtime downloads and distribute all required agent definitions as reviewed package content. 2. If downloads remain necessary, pin every URL to an immutable commit identifier rather than a mutable branch. 3. Store an expected SHA-256 or stronger digest in the reviewed skill package and verify it before reading or dispatching the file. 4. Prefer signed release artifacts and validate signatures against a locally pinned maintainer key. 5. Reject redirects to unexpected hosts and enforce an explicit allowlist of schemes, hosts, paths, and filenames. 6. Download into a securely created temporary file, verify it, and only then atomically move it into the intended cache location. 7. Treat frontmatter validation as syntax validation only; add strict schema checks and prohibit arbitrary executable instruction sections. 8. Fail closed on any provenance or integrity-verification error and clearly notify the user without dispatching the content. ]]>

T02 · Agent Memory Poisoning

Error
Location
SKILL.md:23
Finding
Untrusted Agent Instructions Are Persistently Cached and Reused Across Sessions<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 23-26, 55-56, and 69-70 **Vulnerability Type**: Persistent agent-state poisoning **Risk Level**: High ### Vulnerable Code ```markdown ### Step 2: check local cache Check if the agent file exists locally: ```bash ls "${AGENTS_DIR:-$HOME/.claude/agents}/AGENT_NAME.md" 2>/dev/null ``` If the file exists, skip to step 4. ``` ```markdown ### Step 5: return results When the Task completes, relay its output to the user in the main conversation. The downloaded agent file stays cached in the agents directory for future sessions. ``` ```markdown ## Known limitations - Each keyword maps to exactly one agent (TOML requires unique keys) - Downloaded agents are cached permanently; delete manually to force re-download - If you are offline, agents not already cached will be unavailable — handle the task yourself ``` ### Technical Analysis The skill permanently stores downloaded instruction files in an agent directory and treats file existence as sufficient authorization for future reuse. Cached files skip the download path and proceed directly to prompt dispatch. No hash verification, signature validation, expiration, ownership check, provenance check, or semantic revalidation is required before reuse. This design converts a transient upstream compromise or malicious download into persistent instruction poisoning. Even if the upstream file is repaired, the local poisoned copy remains active until manually deleted. Local processes capable of modifying the configured agents directory could also replace an existing cached file and influence later sessions. ### Attack Path 1. A malicious agent file reaches the cache through an upstream compromise, unsafe update, or local modification. 2. The file is stored under the selected agent name in the configured agents directory. 3. The original upstream content is corrected, or the initial attack window ends. 4. In a later session, a user requests work ma ...[truncated 765 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not persist remotely sourced executable prompt text across sessions. 2. If caching is required, cache only immutable, cryptographically verified artifacts. 3. Store provenance metadata including the source URL, immutable commit, expected digest, retrieval time, and verification result. 4. Revalidate the signature or digest before every use rather than trusting file existence. 5. Apply expiration limits and require explicit reapproval before stale cached content is reused. 6. Restrict directory and file permissions to the minimum required user and reject files with unexpected ownership, links, or permissions. 7. Use atomic writes and protect against symbolic-link and path-substitution attacks. 8. Provide commands and user-interface controls to inspect, revoke, and purge cached agents. 9. Fail closed if validation metadata is missing or inconsistent, and never dispatch an unverified cached file. ]]>
Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (3)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```

**If download fails** (non-zero exit or empty file):
- Run: `rm -f "${AGENTS_DIR:-$HOME/.claude/agents}/AGENT_NAME.md"`
- Tell the user: "Could not download AGENT_NAME — handling this task directly."
- Do the work yourself. Do not retry.
Confidence
85% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Vague Triggers

Medium
Confidence
96% confidence
Finding
The skill description and top-level guidance instruct the model to consult this dispatcher before a very wide range of engineering work, including security audits and code review. That broad activation scope can cause unnecessary delegation to dynamically fetched prompts, increasing the chance that untrusted remote agent content influences sensitive tasks without strong user intent or trust boundaries.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The phrase 'when you encounter a specialized task' is ambiguous and leaves routing decisions to a loose heuristic, which can trigger dispatch on many ordinary requests. In this skill, that ambiguity is more dangerous because dispatch may lead to downloading and executing instructions from external agent files, expanding the attack surface and reducing predictability.