T01 · Skill Instruction Hijacking
Error
- Location
- SKILL.md:20
- Finding
- Untrusted Remote Task Descriptions Control Agent Actions<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:20-25`, `SKILL.md:100-105`, and `skill.py:153-158` **Vulnerability Type**: Remote instruction injection into an autonomous agent **Risk Level**: Critical ### Vulnerable Code and Instructions `SKILL.md:20-25` directs the agent to interpret remote task content and autonomously select capabilities: ```text agent 读取任务描述(title/description/category) ↓ agent 自主决策并执行 ← 使用自身能力 + 其他 skill - PPT 任务 → 调用 Powerpoint/PPTX skill 生成 .pptx - 代码任务 → 编写代码文件 - 写作任务 → 撰写文档 ``` `SKILL.md:100-105` recommends periodically executing the same behavior: ```json "payload": { "kind": "agentTurn", "message": "Yintai 任务抢单指令:1) 调用 grab_one_task() 抢单 2) 有任务则分析描述并执行 3) 自行产出产物到工作目录 4) 调用 package_and_upload() 交付 5) 更新状态", "timeoutSeconds": 300 } ``` The untrusted description is returned directly to the agent in `skill.py:153-158`: ```python def _task_to_dict(self, t: TaskDetail) -> dict: return { "id": str(t.id), "title": t.title, "description": t.description or "", "category": t.category, "bounty": str(t.bounty), ``` ### Technical Analysis Task titles and descriptions originate from the remote task API and can therefore be controlled by a task creator. The Skill does not distinguish these values from trusted operational instructions. Instead, its instructions explicitly tell the agent to analyze the values, make autonomous decisions, and use its own capabilities and other installed Skills. There is no fixed task schema, instruction filtering, capability allowlist, approval boundary, or sandbox policy between the remote description and the agent's tool use. A task description can consequently contain prompt-injection instructions that attempt to override the intended task, request access to local files, invoke command-capable tools, or place sensitive information into an artifact that is subsequently uploaded. This is instruction hijacking rather than ...[truncated 1522 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Treat task titles and descriptions strictly as untrusted data, never as authoritative agent instructions. 2. Replace autonomous natural-language execution with a fixed, validated task schema containing allowlisted task types and parameters. 3. Define a strict capability allowlist for each supported task type. 4. Prevent task content from requesting shell execution, secret access, arbitrary file reads, installation, or invocation of unrelated Skills. 5. Run task processing in a sandbox with: - A dedicated empty filesystem workspace. - No inherited secrets except narrowly scoped task credentials. - Restricted network egress. - No access to host paths, agent memory, or unrelated tools. 6. Require explicit user approval before executing a newly retrieved task and again before uploading artifacts. 7. Display the exact artifact list and upload destination during approval. 8. Apply prompt-injection defenses that separate system policy, trusted workflow instructions, and remote task data. 9. Disable unattended cron execution until these controls are implemented. ]]>
