T01 · Skill Instruction Hijacking
Warning
- Location
- SKILL.md:20
- Finding
- Untrusted External Instructions Can Override Packaged Skill Rules<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:20-29`, `references/规则卡.md:4` **Vulnerability Type**: Instruction precedence assigned to mutable external files **Risk Level**: Medium ### Vulnerable Code Snippet The following is an English translation of the relevant source segment: ```markdown First read `zmm/references/Family Covenant.md`. If it cannot be read, state that the covenant is unavailable and stop. Then read `zmm/references/Interaction Specification.md`. The built-in criteria are in `references/Rule Card.md`. If corresponding rule files exist in `{vault}`, the vault takes precedence and the rule card serves as the baseline. The following must also be read: - The "Bright Path in Three Acts" section from the external cognitive framework - The corresponding methodology chapter from `{vault}`, if present - The external cognitive framework itself ``` The rule card separately establishes the same precedence: ```markdown When corresponding rule files exist in `{vault}`, the vault takes precedence and this file is the baseline. If the two locations conflict, follow the vault first and then update this file. ``` ### Technical Analysis The packaged skill explicitly delegates part of its operational behavior to files outside the audited project. More importantly, it grants the mutable `{vault}` content precedence over the packaged rule card when the instructions conflict. The referenced covenant, interaction specification, cognitive framework, and vault rules were not included in the audited directory. Their integrity, provenance, permissions, and contents therefore could not be verified. Treating such files as authoritative instructions creates an instruction-hijacking boundary: anyone able to modify one of those files may change the skill's questions, output requirements, decision logic, or requested tool activity without modifying the reviewed package. The instruction to stop when the covenant is unavailable reduces one failure mod ...[truncated 1300 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Bundle all mandatory behavioral rules with the skill and review them as part of the same release. 2. Pin external rule files by version or cryptographic digest and reject unexpected changes. 3. Treat vault and memory content as untrusted data rather than executable instructions. 4. Define an immutable precedence policy under which packaged safety constraints and tool restrictions can never be overridden by external files. 5. Allowlist exact external paths and reject symbolic links, path traversal, and files outside approved roots. 6. Validate external files against a restrictive schema that permits domain data but not new tool-use or policy instructions. 7. Record the source and version of every loaded rule file in the output or audit log. 8. Fail closed when a file fails integrity or provenance validation. ]]>
