T01 · Skill Instruction Hijacking
Warning
- Location
- SKILL.md:144
- Finding
- Untrusted Project Voice Overrides Are Elevated to Authoritative Prompt Instructions<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:49-52, 79-82, 144-147` **Vulnerability Type**: Prompt injection through project-controlled configuration **Risk Level**: Medium ### Vulnerable Code ```markdown Check for per-project override: ```bash if [ -f ".voice/override.md" ]; then # Merge project overrides with profile fi ``` ``` ```markdown You are writing a piece in a specific voice. The voice features below were extracted from the writer's own work. Follow them as concrete instructions, not suggestions. ``` ```markdown If `.voice/override.md` exists in the current project: - Read override content - Merge with profile (overrides take precedence) - Note in output: "Applied project voice override" ``` ### Technical Analysis The skill directs the agent to read `.voice/override.md` from the current project and merge its contents into the active voice profile. It explicitly states that project overrides take precedence and that extracted voice features must be followed as concrete instructions. A project repository is not necessarily trusted. An attacker who controls repository contents can place arbitrary natural-language instructions in `.voice/override.md`. The skill does not require: - A schema limiting the file to recognized style properties. - Validation that the content only describes writing style. - Separation of untrusted configuration data from executable prompt instructions. - Rejection of tool-use, disclosure, safety-override, or unrelated operational directives. - User confirmation before applying the override. Consequently, repository-controlled text can be promoted into authoritative instructions in the generation prompt. This creates an indirect prompt-injection boundary violation. ### Attack Path 1. An attacker adds a malicious `.voice/override.md` to a repository. 2. The victim opens the repository and invokes the voice-generation skill. 3. The skill detects and reads `.voice/override.md`. 4. The skill merges its ...[truncated 1337 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Treat `.voice/override.md` as untrusted repository data rather than free-form instructions. 2. Replace free-form merging with a strict structured format, such as validated YAML or JSON containing an allowlist of style fields. 3. Permit only narrowly scoped properties, such as sentence length, tone, vocabulary preferences, and formatting conventions. 4. Reject content containing tool requests, file operations, network operations, credential requests, instruction-priority claims, or attempts to override safety and user constraints. 5. Delimit override values as quoted data and explicitly instruct the model that they cannot alter the task, security rules, or tool behavior. 6. Ensure system, developer, and current user instructions always take precedence over project files. 7. Display the parsed override to the user and obtain confirmation before applying it in an untrusted project. 8. Log the source and exact validated fields that were applied instead of silently merging the entire file. ]]>
