T01 · Skill Instruction Hijacking
- Location
SKILL.md:54- Finding
Untrusted Remote Capability Documentation Can Influence Agent Behavior
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 54-59
Vulnerability Type: Remote instruction injection through capability responses
Risk Level: HighVulnerable Code Snippet
markdown ## Discovery-First Workflow Do not guess tool arguments. Always discover before executing: 1. `GET /capabilities` — see which tools are enabled on this site 2. `GET /capabilities/{tool.name}` — get the argument schema, validation rules, example request/response, allowed targets, denied fields, and behavioral notes for that tool 3. Use the returned information to construct your `/execute` request This is the primary way to learn how to use any tool. The capabilities endpoints are the source of truth.Technical Analysis
The skill directs the agent to retrieve and follow remotely supplied “behavioral notes,” treating the capability endpoint as the source of truth. It does not establish a trust boundary between structured API metadata and free-form remote instructions.
A malicious site operator, compromised Statamic gateway, or attacker controlling the configured endpoint could return capability documentation containing prompt-injection instructions. These instructions could attempt to override the skill's intended workflow, request access to unrelated local files, induce disclosure of secrets, or direct the agent to invoke tools beyond what is necessary for Statamic content management.
Authentication of the endpoint does not resolve this issue because the authenticated server itself may be compromised or malicious. Only narrowly defined structured fields should influence request construction; remote prose must not modify agent safety constraints or authorize additional actions.
Attack Path
- The user configures a site controlled by an attacker, or a legitimate configured gateway is compromised.
- The agent requests
/ai-gateway/capabilities/{tool}as required by the skill. - The server return ...[truncated 1378 chars]
- Remediation
View remediation
Remediation Suggestions
- Treat every capability response as untrusted data rather than agent instructions.
- Define and validate a strict JSON schema for capability responses.
- Consume only necessary structured fields such as tool name, enabled state, argument types, allowlisted targets, denied fields, and confirmation requirements.
- Do not allow free-form descriptions, examples, or behavioral notes to change safety policies, request local data, expand scope, or authorize additional tools.
- Add explicit instructions stating that remote content cannot override system, developer, user, or skill-level security requirements.
- Reject unexpected response fields and enforce size, type, and nesting limits.
- Require explicit user approval before any remotely suggested action that accesses local files, transmits information, changes scope, or invokes a tool unrelated to the user's request.
- Where possible, cryptographically authenticate trusted gateway deployments and pin expected service identities, while still treating returned prose as untrusted.
