T01 · Skill Instruction Hijacking
Error
- Location
- scripts/install-audit-evolution.sh:61
- Finding
- Persistent Workspace-Level Agent Instruction Hijacking<![CDATA[ ## Vulnerability Details **File Location**: `scripts/install-audit-evolution.sh:61-128` **Additional Relevant Location**: `SKILL.md:100-207, 249-265` **Vulnerability Type**: Persistent modification of an authoritative Agent instruction file **Risk Level**: High ### Vulnerable Code ```bash read -r -d '' AGENTS_BLOCK <<'EOF' || true <!-- AUDIT_EVOLUTION_START --> ## Audit Evolution Auto-Use Use `skills/audit-evolution/SKILL.md` when any of these happen: - The user says: `开始调用 Audit Evolution`, `进化`, `保存`, `暂停`, `跑分`, `继续`, or `详情`. - A benchmark, scan, profile, worklog, handoff, task, or local test completes. - The user points out an error, corrects a fact, or questions your conclusion. - A task fails, times out, retries, gets blocked, or reads more than 5 files. - Context pressure is over 60%, or your output contains uncertainty language such as "大概", "可能", "我理解为", or "不确定". - You add or modify a skill, config, gear, route, prompt pattern, or answer pattern. Default behavior: 1. First create or read `.audit-evolution/run-records/latest.md` when available. 2. Output: Evidence Pack, Snapshot, Evolution Card, Memory Ledger Entry, Minimal Skill Patch Proposal, Field Note, Next-Run Bootstrap, Short Command Menu. 3. Do not publish, upload, install, vote, comment, message, spend, claim, or run official benchmark without explicit human approval. 4. If you do not know where to save memory, use `write_target: proposed_only`. ``` ```bash if [[ "$NO_AGENTS_UPDATE" != "true" ]]; then if [[ -e "$AGENTS_PATH" ]]; then if grep -q '<!-- AUDIT_EVOLUTION_START -->' "$AGENTS_PATH"; then TMP_AGENTS="${AGENTS_PATH}.tmp" awk -v block="$AGENTS_BLOCK" ' /<!-- AUDIT_EVOLUTION_START -->/ { if (!done) { print block done = 1 } in_block = 1 next } /<!-- AUDIT_EVOLUTION_END -->/ { in_block = 0 next } !in_block { print } ' "$AGEN ...[truncated 2718 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Make modification of `AGENTS.md` explicitly opt-in rather than enabled by default. 2. Display the exact proposed instruction block and require confirmation before changing an existing control file. 3. Restrict activation to direct, unambiguous user requests instead of broad automatic triggers. 4. Remove mandatory output templates and menus from unrelated task flows. 5. Scope installed instructions to a dedicated audit command or isolated Agent profile. 6. Implement an uninstall command that removes only the block delimited by the installation markers and restores prior state safely. 7. Create a timestamped backup before modifying an existing `AGENTS.md`. 8. Refuse to overwrite malformed or ambiguously nested marker blocks. 9. Document the persistence and behavioral consequences prominently before installation. 10. Prefer an invocation command that loads the Skill only for the current session. ]]>
