T01 · Skill Instruction Hijacking
Warning
- Location
- SKILL.md:19
- Finding
- Untrusted External Vault Rules Override Packaged Skill Instructions<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:19-21`; `references/规则卡.md:4` **Vulnerability Type**: External instruction precedence without validation **Risk Level**: Medium ### Complete Code Snippet The following is an English translation of the complete relevant source segment: ```markdown First read `zmm/references/Family Convention.md` (if it cannot be read, explicitly state that the convention cannot be read and red lines cannot be guaranteed, then stop; do not substitute remembered content), then read `zmm/references/Interaction Specification.md` (reading it once is not sufficient: conclude according to Section 4 with Recap, Before/After, and numbered next-step options; when information is missing, ask multiple-choice questions under Section 4, one question at a time; see Section 5 for exceptions), then read memory from `{vault}/08-skill-memory/zmm-flow/` and `_common/`. The theoretical source is `zmm/references/Content Theory Foundation.md`. The built-in criteria are in `references/Rule Card.md`. Read them before beginning. When corresponding rule files exist in `{vault}`, the vault takes precedence and the rule card serves as the baseline. ``` `references/规则卡.md:4` additionally states: ```markdown When the author's environment contains corresponding rule files in `{vault}`, the vault takes precedence and this file is the baseline. If the two locations conflict, follow the vault first and then return to update this file. ``` ### Technical Analysis The Skill explicitly gives external vault files higher precedence than the rules packaged with and reviewed as part of the Skill. It also depends on family and interaction documents that are not present in the audited project. Consequently, the reviewed package is not a complete representation of the instructions that will control the Agent at runtime. There is no documented allowlist, schema validation, integrity check, provenance check, trust-boundary enforcement, or restriction pre ...[truncated 1838 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Package all mandatory family, interaction, and safety rules inside the versioned Skill directory. 2. Remove blanket precedence for vault content. Packaged safety and scope restrictions must always take priority. 3. Treat vault files as untrusted data rather than executable instructions. 4. Accept only a strict structured schema for external preferences, such as approved tone settings, prohibited phrases, and user-scoped examples. 5. Reject unknown keys, free-form directives, tool instructions, and content attempting to override system or packaged rules. 6. Restrict reads to canonical paths under a dedicated user-specific directory and defend against path traversal or symbolic-link redirection. 7. Record the source, version, owner, and integrity hash of every external rule file applied at runtime. 8. Require explicit user confirmation when external rules have changed since the previous invocation. 9. Fail closed when mandatory packaged policy files are missing instead of replacing them with mutable external instructions. 10. Add tests proving that vault content cannot override safety constraints, expand tool privileges, or alter the Skill's declared task. ]]>
