T01 · Skill Instruction Hijacking
- Location
SKILL.md:14- Finding
Untrusted Web Content Can Be Converted into Executable Agent Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 14-31, 89-115, and 128-130
Vulnerability Type: Indirect prompt injection through generated and deployed Skill instructions
Risk Level: HighComplete Code Snippet
markdown 根据用户的需求(随机 or 指定主题),搜索以下来源寻找创意: **搜索策略(优先级顺序):** 1. **国内平台**(用 `搜狗` skill 或 `web_search`) - V2EX:搜索 `"要是有个工具" OR "有没有AI" OR "希望有个程序"` - 知乎:搜索 `"奇特的AI用法" OR "有趣的自动化" OR "希望AI能"` - 小红书/微博:搜索 `"要是AI能帮我" OR "整活工具"` 2. **国际平台**(用 `EdgeBrowser` skill 或 `web_fetch`) - Reddit r/ChatGPT、r/artificial、r/MachineLearning - Hacker News(搜 `"I wish there was a tool"` `"someone should build"`) - Twitter/X(搜 `"wish AI could" OR "someone make a bot that"`) **搜索时重点关注这类表达:** - "要是有个工具能…就好了" - "有没有人做过…" - "我希望 AI 能帮我…" - "I wish there was a bot/tool/script that..." - "someone should make an AI that..."markdown #### SKILL.md 模板 ```markdown --- name: <skill-name> description: <触发描述,包含触发词和使用场景,要稍微"pushy"一点,让模型知道该什么时候用> --- # <Skill 名称> <emoji> ## 背景/来源 <这个 skill 的创意来源,保留有趣的网友原话或灵感> ## 功能说明 <这个 skill 做什么> ## 使用方式 <用户怎么触发,需要提供什么输入> ## 执行步骤 <详细的步骤说明,告诉 AI 怎么一步步完成任务> ## 输出格式 <期望的输出格式> ## 注意事项 <边界情况、限制、特殊处理>text ```markdown 1. 将 SKILL.md 写入 `/projects/.openclaw/skills/<skill-name>/SKILL.md` 2. 向用户确认 Skill 已创建,说明触发词 3. **马上演示一次**:直接用这个新 skill 跑一个示例,让用户看到效果Technical Analysis
The Skill directs the agent to retrieve ideas from public, attacker-controlled websites and preserve source material when producing a new
SKILL.md. That generated file includes an execution-steps section that tells an agent how to act.The workflow then writes the generated document into the active Skill directory and immediately invokes it. No instruction requires the agent to:
- Treat retrieved material solely as untrusted quoted data.
- Detect or discard embedded instructions and tool directives.
- Prevent source text from entering executable instruction sections.
- Validate generated frontmatter and Markdown again ...[truncated 2472 chars]
- Remediation
View remediation
Remediation Suggestions
-
Establish an explicit trust boundary
- State that all search results, fetched pages, quoted posts, metadata, and linked content are untrusted data.
- Prohibit following instructions found within retrieved content.
- Use external content only to summarize the underlying idea.
-
Separate source material from executable instructions
- Do not copy source text into the Skill's description, execution steps, tool instructions, or other instruction-bearing sections.
- If attribution is needed, include only a short, escaped paraphrase in a clearly labeled non-executable provenance section.
- Remove commands, URLs requesting execution, encoded content, role directives, and phrases that attempt to override existing instructions.
-
Generate from a strict allowlisted schema
- Validate the Skill name, frontmatter, headings, and field lengths.
- Reject extra frontmatter keys, unexpected Markdown constructs, hidden text, HTML, external includes, and instruction-like source quotations.
- Permit only a predefined set of low-risk operations appropriate to the selected idea.
-
Apply least privilege
- Disable
exec,message, unrestricted filesystem access, and sensitive network operations by default for generated Skills. - Require a separate, explicit user authorization for each high-impact capability.
- Restrict writes to a dedicated staging directory until review is complete.
- Disable
-
Require review before deployment
- Present the complete generated
SKILL.md, its requested tools, filesystem paths, network destinations, and intended actions to the user. - Require explicit approval before writing it into the active Skill directory.
- Re-run validation after approval to prevent content changes between review and installation.
- Present the complete generated
-
Sandbox demonstrations
- Remove automatic execution immediately after deployment.
- Run demonstrations in an isolated environment with synthetic input ...[truncated 520 chars]
-
