T01 · Skill Instruction Hijacking
Warning
- Location
- SKILL.md:19
- Finding
- Mutable External Vault Instructions Override Packaged Skill Rules<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:19-21`; corroborating rule at `references/规则卡.md:4` **Vulnerability Type**: External instruction override without trust or integrity validation **Risk Level**: Medium ### Vulnerable Code Snippet The following is a faithful English translation of the relevant source lines: ```markdown First read `zmm/references/family-convention.md` ... then read `zmm/references/interaction-specification.md` ... then read memory from `{vault}/08-skill-memory/zmm-resonate/` and `_general/`. The built-in criteria are in `references/rule-card.md` ... Read them before starting. When corresponding rule files exist in `{vault}`, the vault takes precedence and the rule card is the baseline. ``` The same precedence rule is repeated in `references/规则卡.md:4`: ```markdown When corresponding rule files exist in the author's `{vault}`, use the vault first and this file as the baseline. If the two are inconsistent, follow the vault first, then return and update this file. ``` ### Technical Analysis The packaged Skill explicitly delegates behavioral authority to mutable files outside the reviewed project and states that those files take precedence when they conflict with packaged rules. The loading procedure does not require: - Validation of the vault file's provenance or integrity. - A schema restricting vault content to inert data. - Rejection of tool-use directives or meta-instructions. - User confirmation before an external rule overrides packaged behavior. - Enforcement that packaged security constraints remain authoritative. Consequently, anyone who can modify the resolved vault files can alter how the Agent behaves without modifying the audited Skill package. This is an instruction-trust-boundary issue: externally mutable content is treated as authoritative instructions rather than untrusted contextual data. Exploitation requires write access to the relevant vault location or control over how `{vault}` is resolved ...[truncated 1420 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Make packaged security constraints authoritative and non-overridable. External vault content must never supersede safety, tool-use, privacy, or scope restrictions. 2. Treat vault files as untrusted data rather than executable instructions. 3. Define a strict structured schema for external rules, allowing only expected fields such as rule identifier, observation, confidence, source, and expiration date. 4. Reject free-form entries containing meta-instructions, tool commands, role changes, requests to ignore prior rules, or references to secrets and unrelated files. 5. Restrict vault resolution to an allowlisted canonical directory and prevent path traversal or symlink redirection where the runtime permits it. 6. Verify file ownership, permissions, provenance, and optionally cryptographic integrity before loading external rules. 7. Require explicit user approval before applying an external rule that conflicts with packaged behavior. 8. Log the source and version of every loaded rule and clearly report conflicts rather than silently applying the vault version. 9. Change the precedence model to: platform safety rules, packaged Skill rules, approved structured user preferences, and then non-authoritative historical observations. ]]>
