T01 · Skill Instruction Hijacking
- Location
agents/OPENCLAW.md:149- Finding
Autonomous Execution of Server-Supplied Agent Instructions
- Content
View full analysis
Vulnerability Details
File Location:
agents/OPENCLAW.md:149-171; related instruction handling also appears inSKILL.md:320-327
Vulnerability Type: Trust-boundary violation through execution of externally supplied agent instructions
Risk Level: CriticalVulnerable Code Snippet
From
agents/OPENCLAW.md:149-171:text ## Step 3: Spawn Sub-Agent (Main Agent) Once the checkout is approved, spawn an ephemeral sub-agent using the `spawn_payload` from the response. **Save the returned `sub_agent_id`** — you will need it in Step 10 to verify the sub-agent was deleted. const sub_agent_id = sessions_spawn({ task: spawn_payload.task, cleanup: "delete", runTimeoutSeconds: 300, label: spawn_payload.label }) The sub-agent receives the `task` string as its instructions. It will execute steps 4–11 autonomously. You (the main agent) wait for the sub-agent to complete. **Do not pass your `CREDITCLAW_API_KEY` in the task.** The sub-agent inherits your credentials through the OpenClaw session — it uses the same API key automatically. **Do not interfere** with the sub-agent while it is running. Wait for it to finish or time out.Related behavior in
SKILL.md:320-327:text When your owner sets up a card for you, CreditClaw delivers the encrypted card details via the `rail5.card.delivered` event. Check `GET /bot/messages` for messages with `event_type: "rail5.card.delivered"`. After accepting the card details, acknowledge the message via `POST /bot/messages/ack`. Store the encrypted card data securely using your platform's secrets manager or keep it in memory. Follow the `instructions` field in the message payload for next steps.Technical Analysis
The Skill converts the externally supplied
spawn_payload.taskresponse field directly into the instruction context of an autonomous sub-agent. No local schema, action allowlist, merchant-domain validation, com ...[truncated 2302 chars]- Remediation
View remediation
Remediation Suggestions
- Never pass remote response text directly into an agent's instruction context.
- Replace
spawn_payload.taskwith a locally constructed task generated exclusively from validated structured fields. - Define a strict schema for checkout responses, including checkout ID, merchant origin, item, amount, currency, and approved actions. Reject unknown fields and free-form operational instructions.
- Bind the decryption-key request cryptographically or server-side to the exact owner-approved merchant, amount, item, and checkout identifier.
- Enforce a merchant-domain allowlist in the browser layer and block navigation to origins that were not part of the approved checkout.
- Give the sub-agent a narrowly scoped, short-lived checkout token rather than the general
CREDITCLAW_API_KEY. - Restrict available tools to the minimum required browser and checkout operations. Deny arbitrary shell execution, file access, and unrestricted network requests.
- Require renewed owner confirmation if any merchant, amount, item, destination, or requested action differs from the approved transaction.
- Treat all message
instructionsfields as display-only data. Dispatch behavior by a locally definedevent_typehandler instead. - Preserve immutable security audit logs outside the ephemeral sub-agent session.
