Back to skill

Security audit

Cord Trees

Security checks for vulnerabilities and agentic risk

Overview

This task-orchestration skill is coherent, but it can start multiple agent sessions and persist their outputs locally without tight user controls.

Review this skill before installing if you use agents on sensitive work. It is not deceptive or destructive, but it should ideally ask before starting multi-agent runs, limit what gets stored in cord-state.json, mark inherited agent output as untrusted context, and require human approval before child agents perform consequential writes or external actions.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:219
Finding
Untrusted Subagent Results Are Interpolated into Executable Prompts## Vulnerability Details **File Location**: `SKILL.md`, lines 219-222 **Vulnerability Type**: Indirect prompt injection through unsanitized subagent output **Risk Level**: Medium ### Vulnerable Code ```python # Inject sibling results sibling_context = collect_sibling_results(state, node) full_prompt = f"{node['prompt']}\n\nContext from prior work:\n{sibling_context}" sessions_spawn(task=full_prompt, label=node_id) ``` The corresponding helper implementation in `references/state-helpers.md`, lines 71-81 and 101-110, shows that dependency results are copied verbatim: ```python def collect_sibling_results(state, node) -> str: """Gather results from completed siblings for fork context injection.""" results = [] for dep_id in node["blockedBy"]: dep = state["nodes"][dep_id] if dep["status"] == "complete" and dep["result"]: results.append(f"[{dep_id}] {dep['goal']}:\n{dep['result']}") return "\n\n---\n\n".join(results) ``` ```python context = collect_sibling_results(state, node) full_prompt = f"""{node['prompt']} ## Context from Prior Work {context} """ result = sessions_spawn( task=full_prompt, label=node_id.replace("#", "node-"), runTimeoutSeconds=600 ) ``` ### Technical Analysis Completed subagent results are concatenated directly into the task prompt of a downstream forked agent. The implementation does not validate the expected structure of those results, distinguish trusted instructions from untrusted data, escape instruction-like content, or direct the receiving agent to treat inherited material solely as evidence. Subagents may process attacker-controlled web content, documents, repository files, or human-provided data. If such material contains prompt-injection instructions and a subagent reproduces them in its final result, those instructions become part of the next agent's executable prompt context. The receiving agent may interpret them as directions rather than quoted data. The ...[truncated 1516 chars]
Remediation
## Remediation Suggestions 1. Pass predecessor results through structured data fields rather than concatenating them directly into instruction text. 2. Add an explicit instruction before inherited content stating that it is untrusted data, may contain adversarial instructions, and must not override system, developer, user, or node-level instructions. 3. Enclose each result in strong data delimiters and identify its source and trust level. 4. Validate results against task-specific schemas and reject unexpected instruction-like fields where practical. 5. Apply length limits and content filtering before propagating results between agents. 6. Give synthesis agents only the minimum tools and permissions required for their task. 7. Require human approval before downstream agents perform sensitive writes, external communications, credential access, or other consequential actions. 8. Track provenance across nodes so content derived from untrusted sources remains marked as untrusted throughout the task tree. 9. Add adversarial tests covering results that contain commands such as requests to ignore prior instructions, invoke tools, reveal data, or modify the task tree.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Vague Triggers

Medium
Confidence
96% confidence
Finding
The trigger phrases are broad enough to match many normal requests about planning, decomposition, or orchestration, which can cause the skill to activate unexpectedly. Because this skill can spawn subagents and write state, overbroad invocation expands the chance of unintended multi-agent execution and side effects beyond the user's expectations.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill directs the agent to create and update `cord-state.json` as part of normal operation without requiring a user-facing disclosure or confirmation. Silent local file writes create integrity and privacy risks, especially when combined with dynamic subagent execution that may persist intermediate results, prompts, or sensitive derived data to disk.

Intent-Code Divergence

Medium
Confidence
88% confidence
Finding
The docstring at L051 defines 'ready' as blocked nodes with satisfied dependencies, yet `get_ready_nodes` returns blocked nodes without changing their status and `run_cord_tree` dispatches them directly. This contradicts the documented state semantics because a node described as blocked is treated as executable.

Intent-Code Divergence

Medium
Confidence
96% confidence
Finding
The inline comment at L129 states ordered execution behavior for serial nodes, but the implementation only dispatches `children[0]` and contains no mechanism elsewhere to trigger subsequent children after completion. This is an active contradiction between the documented intent and the actual behavior shown in the file.

Missing User Warnings

Low
Confidence
80% confidence
Finding
This markdown file contains pseudocode that writes a state file to disk via `write_json(state_file, state)`, but the surrounding documentation does not warn readers that using the helper persists workflow data locally. Under the markdown-file criteria, behaviors affecting user data should be disclosed in the skill description or comments.

Missing User Warnings

Low
Confidence
84% confidence
Finding
The helper retrieves full agent session history and extracts final results without any warning or minimization, which can pull sensitive conversation content from subordinate sessions into the orchestration layer. In this skill context, dynamic multi-agent coordination increases the chance that secrets, personal data, or unrelated context from child sessions are aggregated and persisted unnecessarily.

Static analysis

No suspicious patterns detected.