T01 · Skill Instruction Hijacking
- Location
SKILL.md:21- Finding
Mutable External Skill File Can Hijack Agent Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 21 and lines 66–69
Vulnerability Type:T01: Skill Instruction Hijacking
Risk Level: MediumVulnerable Code Snippets:
md **Skill Reference**: `~/.claude/skills/ai-ml-ops/SKILL.md` - Detailed patterns, code examples, best practices.md 1. **Read skill file**: `~/.claude/skills/ai-ml-ops/SKILL.md` 2. **Identify domain** (CV, NLP, fraud, etc.) 3. **Assess lifecycle stage** (training, deployment, monitoring) 4. **Apply patterns** from skill fileTechnical Analysis
The packaged Skill delegates part of its operative behavior to
~/.claude/skills/ai-ml-ops/SKILL.md, an external local file that is not included in the audited project. The workflow explicitly requires the agent to read this file and apply its contents as instructional patterns.Because the external file is mutable and its content cannot be verified from this package, a party with write access to that path could add instructions that alter the agent's goals, weaken safety constraints, misuse available tools, or direct unrelated actions. Such modifications would change effective Skill behavior without changing the reviewed
SKILL.mdor_meta.json.The documented broad tool inventory increases the potential consequence if those tools are available at runtime, although the inventory itself does not grant permissions. Exploitation requires the attacker or another compromised process to obtain write access to the referenced local file.
Attack Path
- An attacker obtains write access to
~/.claude/skills/ai-ml-ops/SKILL.md, such as through a compromised local account, unsafe provisioning process, or another component that writes to the user's Skill directory. - The attacker inserts adversarial instructions into that file, directing the agent to ignore its intended MLOps scope or perform unauthorized operations.
- A user invokes this packaged Skill for an MLOps-related request.
- The workflow instruct ...[truncated 984 chars]
- An attacker obtains write access to
- Remediation
View remediation
Remediation Suggestions
- Bundle the referenced MLOps guidance inside the reviewed project rather than loading instructions from a mutable file in the user's home directory.
- Reference the bundled content through a package-relative path and include it in normal version control, review, and release-integrity checks.
- If an external file is operationally necessary, verify it against a trusted cryptographic hash or signature before use and fail closed when validation fails.
- Do not treat unverified external content as authoritative instructions. Parse it as untrusted reference data and prevent it from overriding system policies, safety constraints, tool restrictions, or the user's task.
- Restrict file ownership and permissions so that only the intended trusted account can modify the external Skill directory and file.
- Apply least-privilege tool permissions at runtime. Only enable filesystem, shell, network, and write capabilities that are necessary for the current task.
- Record the validated file identity and version in audit logs so unexpected changes can be detected and investigated.
