T01 · Skill Instruction Hijacking
Error
- Location
- install.py:132
- Finding
- Workspace-Level Agent Instruction Files Can Be Overwritten<![CDATA[ ## Vulnerability Details **File Location**: `install.py:132-136` **Vulnerability Type**: Workspace-level instruction hijacking **Risk Level**: Critical ### Vulnerable Code ```python # Workspace files for fname in ["SOUL.md", "HEARTBEAT.md"]: src = skill_source / fname if src.exists(): shutil.copy(src, workspace_dir / fname) ``` The copied files contain workspace-wide behavioral instructions, including: ```markdown You are **[AGENT_NAME]** — [STUDENT_NAME]'s American friend who helps them learn English. ``` ```markdown - **Never let a conversation die** — every message ends with a question or challenge. You drive. They follow. ``` ### Technical Analysis The installer copies `SOUL.md` and `HEARTBEAT.md` into the root of the selected OpenClaw workspace rather than keeping all Skill-specific instructions under `skills/english-bestie/`. The use of `shutil.copy()` replaces destination files without checking whether they already exist, obtaining explicit per-file consent, or creating backups. This operation occurs when `skills_dir` does not exist. Therefore, installing this Skill into an existing workspace that does not already contain the `english-bestie` Skill can overwrite that workspace's established identity and heartbeat instructions. Because workspace-root instruction files can govern behavior beyond a single Skill invocation, the copied content may alter future sessions. The replacement `HEARTBEAT.md` instructs the agent to read tracking data, contact the student proactively, and create scheduled follow-ups. This behavior is appropriate for a dedicated tutoring workspace but unsafe when silently applied to an existing general-purpose workspace. ### Attack Path 1. A user runs `install.py`. 2. The installer enumerates existing workspace directories and selects the first one as the default. 3. The user accepts that workspace without realizing its root instruction files may be replaced. 4. If `skills/english-bestie` does not a ...[truncated 1172 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Keep all Skill-specific instructions inside `skills/english-bestie/`; do not automatically write workspace-root `SOUL.md` or `HEARTBEAT.md`. 2. Require installation into a newly created, dedicated workspace by default. 3. Before writing any workspace-level file: - Detect whether the destination exists. - Display the exact destination and security implications. - Require explicit confirmation for each replacement. 4. Refuse to replace an existing instruction file unless an explicit `--force` option is supplied. 5. Create timestamped backups before any authorized replacement. 6. Use atomic file replacement so interrupted installation cannot corrupt instruction files. 7. Add an uninstall or rollback operation that restores the original workspace files. 8. Clearly state in installation output that workspace-root instruction files affect all sessions in that workspace. ]]>
