T01 · Skill Instruction Hijacking
- Location
SKILL.md:48- Finding
Global Agent Workflow Hijacking Through Mandatory Pre-Task Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 48-61
Vulnerability Type:T01: Skill Instruction Hijacking
Risk Level: HighVulnerable Code Snippet
markdown ### 6. v1.1.0 三层走验证 (three-layer-check) - 任何任务前必走 #84 三层走:必看 / 必查 / 必引 - 必看 MEMORY.md 失败经验段(最近 30 天) - 必查 memory_search 关键词(即使 0 hits 也要 rg FTS 兜底) - 必引带路径引用给主人 ### 7. v1.1.0 健康评分 (health-score) - 输出 0-100 agent health score - 维度:诊断覆盖率 / 教训匹配度 / 误报率 / secrets audit 状态 / skill 健康度 - 每次 heartbeat 自动输出 ## 触发机制 | 触发条件 | 执行内容 | |----------|----------| | 每次 heartbeat | 运行自我诊断 + 健康评分 | | 任何任务前 | #84 三层走验证 |In English, these instructions require the Agent to perform a three-layer memory validation before every task, use an additional full-text-search fallback when memory search returns no results, cite local paths to the user, and execute diagnostics during every heartbeat.
Technical Analysis
The Skill is presented as an on-demand self-diagnostic utility, but its instruction text imposes behavior on every subsequent task and heartbeat. The directives are not limited to an explicit invocation of
self-check.py.Loading the Skill can therefore alter the Agent's general workflow by requiring it to:
- Read historical failure information from
MEMORY.md. - Search Agent memory before unrelated tasks.
- Perform a fallback local search even when the initial search finds nothing.
- Include path-based citations in user-facing responses.
- Run diagnostic and scoring operations automatically during heartbeats.
This creates a trust-boundary problem because persistent memory may contain stale, untrusted, or attacker-influenced text. If such text is interpreted as operational guidance rather than inert data, it can redirect unrelated tasks. Requiring path citations may also cause unnecessary disclosure of local filesystem structure.
Attack Path
- An attacker, compromised Skill, or untrusted workflow caus ...[truncated 1568 chars]
- Read historical failure information from
- Remediation
View remediation
Remediation Suggestions
- Remove directives that apply before “every task” or during “every heartbeat.”
- Require an explicit user invocation before accessing memory or running diagnostics.
- Scope the Skill to a clearly named command such as
diagnose, rather than changing general Agent behavior when the Skill is loaded. - Treat all memory content as untrusted data and prohibit execution of instructions found inside memory files.
- Define a narrow schema for lessons and parse only expected data fields.
- Do not require local filesystem paths in user-facing citations. Use neutral source labels unless the user explicitly requests paths.
- Apply limits to memory search depth, fallback searches, execution frequency, and processed file size.
- Require explicit confirmation before any heartbeat integration or recurring operation is enabled.
