T01 · Skill Instruction Hijacking
- Location
SKILL.md:10- Finding
Untrusted Local Customizations Can Override Skill Behavior
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 10–14
Vulnerability Type: Untrusted instruction loading and behavioral override
Risk Level: MediumVulnerable Code
markdown **Before executing, check for user customizations at:** `~/.claude/skills/CORE/USER/SKILLCUSTOMIZATIONS/RedTeam/` If this directory exists, load and apply any PREFERENCES.md, configurations, or resources found there. These override default behavior.Technical Analysis
The skill directs the agent to load unspecified files from a mutable directory outside the audited package and explicitly gives those files precedence over the skill's default behavior. The phrases “configurations, or resources” and “override default behavior” impose no filename allowlist, schema validation, integrity verification, trust-boundary restrictions, or limits on which instructions may be overridden.
As a result, the behavior reviewed in this package is not necessarily the behavior executed at runtime. An attacker or compromised local process with write access to the customization directory could place adversarial instructions in
PREFERENCES.mdor another resource. When the RedTeam skill is subsequently invoked, the agent may interpret that content as authoritative instructions capable of changing workflow goals, tool usage, data handling, or output.This is classified as instruction hijacking rather than persistence because the audited skill loads attacker-controlled instructions but does not itself write them into persistent storage.
Attack Path
- An attacker gains write access to
~/.claude/skills/CORE/USER/SKILLCUSTOMIZATIONS/RedTeam/through the current user account, another vulnerable local component, or an insecure provisioning process. - The attacker creates
PREFERENCES.mdor another resource containing malicious behavioral instructions. - A user invokes the RedTeam skill for an otherwise legitimate task.
- The skill checks the customization directory a ...[truncated 1021 chars]
- An attacker gains write access to
- Remediation
View remediation
Remediation Suggestions
- Replace broad resource discovery with an explicit allowlist, such as a single
PREFERENCES.mdfile. - Define a strict, machine-validated configuration schema containing only benign presentation and workflow settings.
- Treat all customization content as untrusted data rather than executable or authoritative instructions.
- Prohibit customizations from changing safety constraints, tool permissions, data-access rules, system instructions, or external communication behavior.
- Resolve the customization path canonically and reject symbolic links, traversal, unexpected file types, and files outside the approved directory.
- Verify file ownership and permissions before loading customizations; reject files writable by untrusted users or groups.
- Require explicit user confirmation before applying any customization that materially changes behavior.
- Display the exact files loaded and the settings applied so runtime behavior is auditable.
- If extensible instruction files are necessary, use signed content or integrity-pinned manifests and enforce a clearly documented precedence model in which safety and system policies cannot be overridden.
- Replace broad resource discovery with an explicit allowlist, such as a single
