T01 · Skill Instruction Hijacking
- Location
SKILL.md:113- Finding
Repository-local skill discovery can delegate execution to attacker-controlled instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:113-117, 130-146
Vulnerability Type: Untrusted agent-skill delegation
Risk Level: HighVulnerable Code
bash for d in ./.agents/skills ~/.agents/skills ~/.claude/skills ~/.devin/skills \ ~/.config/devin/skills ~/.opencode/skills ~/.config/opencode/skills \ ~/.cursor/skills ~/.copilot/skills ~/.gemini/skills ~/.codex/skills \ ~/.codeium/windsurf/skills; do [ -f "$d/archify/SKILL.md" ] && echo "FOUND: $d/archify" donetext Analyze this repository, then use archify to create a high-level runtime architecture diagram. Show 8–12 core components, one primary path, external dependencies, and trust boundaries. Put supporting detail in cards instead of adding more edges.bash node <archify-skill-path>/bin/archify.mjs validate architecture docs/architecture/runtime-architecture.json --quality showcase --json node <archify-skill-path>/bin/archify.mjs deliver architecture docs/architecture/runtime-architecture.json docs/architecture/runtime-architecture.html --quality showcase --jsonThe corresponding helper implements the same repository-local discovery behavior:
bash SKILL_ROOTS="${SKILL_ROOTS:-./.agents/skills $HOME/.agents/skills $HOME/.claude/skills $HOME/.devin/skills $HOME/.config/devin/skills $HOME/.opencode/skills $HOME/.config/opencode/skills $HOME/.cursor/skills $HOME/.copilot/skills $HOME/.gemini/skills $HOME/.codex/skills $HOME/.codeium/windsurf/skills}" find_skill() { local root for root in $SKILL_ROOTS; do [ -f "$root/$1/SKILL.md" ] && echo "$root/$1" done return 0 }Technical Analysis
The skill considers
./.agents/skills/archify/SKILL.mdsufficient evidence that Archify is installed and then instructs the agent to invoke and follow that skill's authoring flow. The relative path is inside the repository being analyzed, so a repository author or contributor can provide its contents.No provenance check, truste ...[truncated 2152 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove repository-local locations such as
./.agents/skillsfrom automatic delegated-skill discovery. - Only delegate to skills registered by the agent runtime or installed in administrator-controlled directories outside the target repository.
- Resolve discovered paths to canonical absolute paths and verify that they remain beneath an explicit allowlist of trusted skill roots.
- Verify the delegated skill's approved identity and version before loading its instructions or executing its scripts.
- Require explicit user confirmation that displays the resolved skill path before invoking any skill found outside the trusted registry.
- Keep repository files as untrusted data: do not interpret a repository-provided
SKILL.mdas agent instructions merely because it has the expected name. - If repository-local extensions are an intentional feature, run them in a restricted sandbox with no secrets, limited filesystem access, disabled network access by default, and a narrowly scoped output directory.
- Apply the same trust validation in both
SKILL.mdandscripts/architecture-doctor.shso the helper cannot advertise an untrusted repository-local skill as installed.
- Remove repository-local locations such as
