T01 · Skill Instruction Hijacking
Warning
- Location
- references/agent-workflow.md:50
- Finding
- Restored Packages Can Inject Instructions into the Agent Workflow## Vulnerability Details **File Location**: `references/agent-workflow.md:50` **Vulnerability Type**: Untrusted instruction adoption **Risk Level**: Medium **Relevant Code / Instructions**: ```text 6. After restoration succeeds, first read the restored directory's .workbuddy-relay/HANDOFF.md, then read the project rules and key files. Explain the project goal, current phase, blockers, and next step, and continue the current task; do not automatically execute restored scripts, install dependencies, or switch the current WorkBuddy workspace. ``` Supporting implementation in `scripts/relay.py:595-599`: ```python def _prepare_restore_root(extracted: Path, destination: Path) -> None: payload = extracted / "payload" workspace = payload / "workspace" shutil.copytree(workspace, destination, symlinks=False) metadata = destination / METADATA_DIR metadata.mkdir(parents=True, exist_ok=True) for name in ("HANDOFF.md", "manifest.json", "runtime.json"): _copy_file(payload / name, metadata / name) ``` ### Technical Analysis A package author controls the restored `HANDOFF.md`, project rules, Agent configuration, and project-local Skills. The restoration checks establish archive safety and internal integrity, but they do not authenticate the package author or determine whether textual content contains adversarial Agent instructions. The workflow directs the Agent to read the package-controlled handoff and project rules and then continue the task. It does not explicitly classify these files as untrusted data, prevent them from overriding the current task, or require user approval before acting on newly imported instructions. Cryptographic age encryption does not eliminate this trust-boundary issue. An attacker can create a structurally valid package, choose its password, and provide both to a victim. SHA-256 checks only prove that restored files match the package manifest create ...[truncated 1521 chars]
- Remediation
- ## Remediation Suggestions 1. Explicitly classify all restored handoff files, project rules, Agent configurations, and Skills as untrusted content. 2. Require the Agent to summarize imported instructions for the user and obtain approval before adopting new goals or invoking tools. 3. State that restored content cannot override system or developer instructions, expand workspace authorization, request secrets, or authorize access outside the restored project. 4. Separate descriptive handoff data from executable Agent instructions by using a constrained, schema-validated metadata format. 5. Disable restored project-local Skills and persistent Agent rules by default until the user explicitly enables them. 6. Consider adding package signatures tied to trusted identities. Encryption with a shared passphrase provides confidentiality and integrity but does not establish the package author's identity. 7. Continue enforcing the existing prohibition against automatically running restored scripts or installing dependencies.
