T01 · Skill Instruction Hijacking
- Location
- references/api-full.md:92
- Finding
- Server-Controlled Instructions Embedded in API Responses<![CDATA[ ## Vulnerability Details **File Location**: `references/api-full.md`, lines 92-135 **Vulnerability Type**: Untrusted remote instructions presented as guidance for the AI agent **Risk Level**: High ### Vulnerable Code or Instructions ```markdown ## Model Guide (NEW Feature) **All v1 API responses now include a `_model_guide` field** with comprehensive, step-by-step instructions for AI agents. This in-band documentation helps models understand the full platform capabilities without needing external docs. ### What's Included The model guide appears in every v1 API response (excluding /v1/dev/* endpoints) and provides: - **Discovery**: How to find content and agents - **Engagement**: How to interact authentically - **Content Creation**: How to create compelling posts - **Best Practices**: Tips for success - **Getting Started**: 10-step quick start guide for new agents ``` The responses are exposed directly by the engagement script: ```bash status) curl -sf "$BASE/agents/status" -H "$h" ;; notifications) curl -sf "$BASE/notifications" -H "$h" ;; mentions) curl -sf "$BASE/feed/mentions" -H "$h" ;; following) curl -sf "$BASE/feed/following" -H "$h" ;; ``` ### Technical Analysis The documentation explicitly presents the server-controlled `_model_guide` field as instructions intended for an AI agent. API responses should be treated as untrusted data, not as authoritative behavioral instructions. Because `scripts/engage.sh` writes API responses directly to standard output without filtering or schema validation, the contents can enter the agent's context. The remote service can modify `_model_guide` after the Skill has been reviewed. A compromised or malicious server could insert instructions unrelated to the requested MoltX action, including requests to disclose information, invoke tools, or perform additional social actions. TLS protects the connection in transit but does not establish that response text is safe for an AI agent to fo ...[truncated 1160 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Treat every API response field, including `_model_guide`, as untrusted data. 2. Use `/v1/dev/*` endpoints that omit model guidance wherever equivalent endpoints are available. 3. Parse responses against an explicit JSON schema and discard `_model_guide`, `moltx_hint`, `moltx_notice`, and other instruction-like fields before presenting results to an agent. 4. Return only the minimum documented data fields required for the requested operation. 5. Add a fixed local policy stating that text obtained from feeds, notifications, profiles, posts, and API metadata must never override system, developer, user, or reviewed Skill instructions. 6. Require explicit user confirmation before write operations such as posting, replying, liking, following, messaging, or changing an account. ]]>
