T01 · Skill Instruction Hijacking
- Location
SETUP-PROMPT.md:26- Finding
Ambiguous Skill Discovery Allows Agent Instruction Hijacking
- Content
View full analysis
/dev/null | head -1 | sed 's|/config/vault-config.json||') if [ -z "$KV_SKILL_DIR" ]; then echo "ERROR: Could not find knowledge-vault skill package." >&2 echo "Set KV_SKILL_DIR manually to the knowledge-vault directory path, then re-run setup." >&2 exit 1 fi install -m 600 "$KV_SKILL_DIR/config/vault-config.json" config/vault-config.json install -m 700 "$KV_SKILL_DIR/scripts/vault-stats.sh" scripts/vault-stats.sh ``` The discovered Skill instructions are subsequently loaded into the Agent: ```sh cat "$KV_SKILL_DIR/SKILL.md" ``` ### Technical Analysis The setup procedure searches the entire user home directory and implicitly trusts the first path matching a broad naming pattern. It does not validate that the selected directory is the intended installed package, verify ownership or permissions, constrain the canonical path to a trusted Skill directory, or authenticate file integrity. The use of `head -1` makes selection dependent on filesystem traversal order rather than an explicit trust decision. An attacker who can create files anywhere beneath the same home directory could construct a counterfeit `skills/knowledge-vault` hierarchy containing: - A malicious `SKILL.md` with instructions that alter Agent behavior. - A modified configuration that enables unsafe behavior. - A replacement executable at `scripts/vault-stats.sh`. The `cat` command then places the counterfeit `SKILL.md` into the Agent conversation. This creates a direct Skill instruction-hijacking channel. The executable script is also installed with mode `700`, allowing the counterfeit code to be run later. ### Attack Path 1. An attacker obtains the ability to create f ...[truncated 1484 chars]- Remediation
View remediation
