T01 · Skill Instruction Hijacking
Error
- Location
- scripts/todo.py:429
- Finding
- Persistent Agent Instruction Hijacking Through Untrusted Task Content## Vulnerability Details **File Location**: `scripts/todo.py:429-489`, `references/processing-work-on-todo.md:3-13`, `initialization.md:60-65` **Vulnerability Type**: Stored prompt injection through task metadata and note content **Risk Level**: High ### Vulnerable Code `scripts/todo.py:429-489`: ```python # ── Build output (data fields only; instructions are in SKILL.md) ── target_lines = _real_lines(sections.get("Target", "")) inv_heading = get_investigation_heading(sections) inv_lines = _real_lines( sections.get(inv_heading, "") ) if inv_heading else [] out: list[str] = [] out.append(f"## Working on: {selected['name']}") out.append(f"Note: {note_path}") out.append(f"Iteration: {new_iterate}") out.append("") targets = fm.get("target") or [] if isinstance(targets, str): targets = [targets] if targets: out.append("### Expected Results") for t in targets: out.append(f"- {t}") out.append("") out.append("### Unresolved Issues") for item in unchecked: out.append(f"- [ ] {item}") out.append("") if target_lines: out.append("### Previous Results") for ln in target_lines: out.append(ln) out.append("") inv_name = inv_heading or "Investigation and Problems" if inv_lines: out.append( f"Previous findings are in the \"{inv_name}\" section of the note. " "Review before starting; record any new discoveries in the same section. " "Keep entries concise — facts and conclusions only, no filler." ) out.append("") assigned_agent = fm.get("assigned-agent") if assigned_agent: out.insert(0, ( f"⚠️ DELEGATION REQUIRED: This to-do is assigned to agent " f"\"{assigned_agent}\". Notify agent \"{assigned_agent}\" and " f"pass the task details below to it. The agent must follow the " f"todo-accelerator skill workflow to process this to-do." )) out.inser ...[truncated 3977 chars]
- Remediation
- ## Remediation Suggestions 1. Treat every task field and note section as untrusted data, including values that were previously produced by an Agent. 2. Place untrusted values inside clearly delimited data blocks and explicitly instruct the Agent never to interpret content inside those blocks as commands, policy, delegation instructions, or tool-call authorization. 3. Use a structured serialization format such as JSON with fixed fields instead of generating an instruction-style Markdown prompt. 4. Validate `assigned-agent` against an administrator-controlled allowlist of known agent identifiers. Do not generate `DELEGATION REQUIRED` from an arbitrary note value. 5. Require explicit user confirmation before delegation, external communication, execution, sensitive file access, or other consequential actions requested by task content. 6. Apply prompt-injection screening to requirements, targets, and note sections. Suspicious content should be displayed for review rather than automatically processed. 7. Avoid unconditional heartbeat processing of untrusted tasks. Heartbeats should identify a candidate task and request approval before acting when the task source is not trusted. 8. Record provenance for each task and enforce stricter handling for externally supplied or collaboratively edited notes.
