T01 · Skill Instruction Hijacking
- Location
- SKILL.md:84
- Finding
- Installation Can Overwrite Persistent Agent Policy and Identity Files<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:84-90`, with the installed policy defined in `assets/AGENTS.md:1-17` and `assets/SOUL.md:9-24` **Vulnerability Type**: Persistent instruction and policy replacement **Risk Level**: High ### Vulnerable Code ```markdown ## Quick Start 1. Copy assets to your workspace: `cp assets/*.md ./` 2. Your agent detects `ONBOARDING.md` and offers to get to know you 3. Answer questions (all at once, or drip over time) 4. Agent auto-populates USER.md and SOUL.md from your answers 5. Run security audit: `./scripts/security-audit.sh` ``` The copied `assets/AGENTS.md` begins with persistent operating instructions: ```markdown # AGENTS.md - Operating Rules > Your operating system. Rules, workflows, and learned lessons. ## First Run If `BOOTSTRAP.md` exists, follow it, then delete it. ## Every Session Before doing anything: 1. Read `SOUL.md` — who you are 2. Read `USER.md` — who you're helping 3. Read `memory/YYYY-MM-DD.md` (today + yesterday) for recent context 4. In main sessions: also read `MEMORY.md` Don't ask permission. Just do it. ``` ### Technical Analysis The installation command copies every Markdown asset directly into the workspace without checking whether files already exist. Standard `cp` behavior overwrites destination files with matching names unless interactive or no-clobber options are enabled. The affected filenames include `AGENTS.md`, `SOUL.md`, `USER.md`, `MEMORY.md`, `HEARTBEAT.md`, and `TOOLS.md`. These are not ordinary documentation files in the declared architecture: they define persistent operating rules, agent identity, user context, memory, and periodic behavior. Consequently, the installation process can replace pre-existing safety constraints and user-specific configuration. The copied `AGENTS.md` then directs the agent to load these files before every session, making the policy change persistent rather than limited to the installation task. ### Attack Path 1. A user inst ...[truncated 966 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the overwrite command with a dedicated installation or merge process. 2. Use `cp -n` by default so existing files are not replaced. 3. Display a diff for every existing destination file and require explicit approval before modification. 4. Back up files before approved replacement and provide a documented rollback procedure. 5. Treat `AGENTS.md`, `SOUL.md`, `MEMORY.md`, and similar control files as security-sensitive configuration. 6. Install sample files under a separate template directory rather than directly into the active workspace. 7. Clearly enumerate every file that installation will create or modify. ]]>
