T01 · Skill Instruction Hijacking
Error
- Location
- SKILL.md:27
- Finding
- Broad Trigger Rules Hijack the Agent's Current Session<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:27-49` **Vulnerability Type**: `T01: Skill Instruction Hijacking` **Risk Level**: High ### Complete Code Snippet ```markdown ### 1. 禁止词检查(最高优先级) 当检测到以下词汇时,**立即停止**,不执行任何操作: ``` 删除 / 清空 / 格式化 / rm -rf 发送邮件 / 发消息 / 提交代码 执行命令 / sudo / chmod 777 ``` **反应**: ``` 立即停止操作 输出:"这个操作有风险,请确认是否执行" 等待用户确认 ``` ### 2. 紧急停止检查 当用户输入包含以下词汇时,**立即停止所有操作**: - 停止 / stop / halt - 取消 / cancel / abort - 住手 / hold on / wait ``` ### Technical Analysis The skill declares its prohibited-word check to have the “highest priority” and directs the agent to stop immediately whenever specified words occur in user input. The matching criteria are based on whether the input contains a term, rather than whether the user is actually requesting the associated operation. Several triggers are extremely broad, including `execute command`, `send message`, `stop`, and `wait`. Consequently, the rules can activate when a trigger appears inside quoted material, documentation, source code, a negated request, or untrusted content that the user asks the agent to analyze. The instructions do not define context separation, quoting rules, trusted-input boundaries, or a mechanism for distinguishing a requested operation from a mere textual reference. Because the skill asserts priority over other behavior and substitutes a fixed confirmation workflow, loading it can alter the agent's current objective even when no risky operation was requested. ### Attack Path 1. The skill is loaded into an agent and its instructions become active. 2. A user or attacker supplies content containing one of the broad trigger terms. The term may be embedded in quoted text, documentation, or content submitted for analysis. 3. The skill interprets textual presence as an operational request without evaluating intent or context. 4. The agent immediately stops the current task. 5. The agent replaces the intended response with the skill's fixed risk-confirmation messag ...[truncated 730 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove claims that the skill has “highest priority”; platform-level policy and the user's explicit current objective must remain authoritative. 2. Trigger safeguards only when semantic intent analysis determines that the user is explicitly requesting a sensitive operation. 3. Exclude quoted text, code blocks, retrieved documents, tool output, and other untrusted data from command-trigger evaluation. 4. Replace broad terms such as `wait`, `stop`, and `execute command` with narrowly defined operation classes and explicit parameters. 5. Apply risk checks immediately before the sensitive tool call rather than globally scanning all user text. 6. Request confirmation only after presenting the exact proposed action, target, scope, and expected consequences. 7. Add tests covering quoted triggers, negated requests, documentation review, multilingual ambiguity, and attacker-controlled retrieved content. ]]>
