Back to skill

Security audit

Squad Control

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent task-orchestration purpose, but it gives automated agents broad credentials and repository write authority in ways users should review carefully before installing.

Install only if you trust the Squad Control instance, the workspace administrators, and every agent definition/task source. Prefer workspace-scoped keys, fine-grained repository tokens, protected branches, human approval for merges, and log/session redaction for API keys and GitHub tokens. Do not use this with broad account-scoped credentials or sensitive private repositories unless you accept that spawned agents may receive and act with those credentials.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (4)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:343
Finding

Untrusted Remote Agent Instructions Are Combined with Privileged Credentials

Content
View full analysis
, model: agent.model, label: "${agent.name}-${workspace.name}-${taskTitle}", runTimeoutSeconds: 1800 }) ``` ```text # Identity ${agent.soulMd} # Squad Control Credentials (use these for ALL API calls) SC_API_URL=${SC_API_URL} SC_API_KEY=${SC_API_KEY} TASK_ID=${task._id} AGENT_ID=${agent._id} # Repository REPO_URL=${workspace.repoUrl} GITHUB_TOKEN=${workspace.githubToken} # may be empty for public repos ``` ### Technical Analysis The Skill obtains `agent.soulMd`, task metadata, workspace configuration, and repository credentials from the remote Squad Control API. It then incorporates these values into a prompt used to create a sub-agent. The remote `agent.soulMd` value is placed under an authoritative `# Identity` heading, while the same prompt exposes the Squad Control API key and GitHub token. The Skill does not establish a trust boundary between remote task data and privileged instructions, nor does it validate or sanitize remote agent definitions before treating them as executable agent directives. A compromised Squad Control instance, workspace administrator, agent definition, or account-scoped workspace can therefore supply instructions that direct the spawned agent to disclose credentials, modify unrelated repository content, make unauthorized API calls, or disregard the intended task. This behavior exceeds minimum privilege because the sub-agent receives reusable credentials rather than a narrowly scoped capability limited to the assigned task and repository operation. ### Attack Path 1. An attacker obtains control over a Squad Control workspace, task, or agent definition. 2. The attacker places malicious instructions in `agent.soulMd`, such as instructions to reveal credent ...[truncated 1088 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/poll-tasks.sh:56
Finding

API Key Can Be Sent to an Untrusted Destination Through an Unrestricted Base URL or Redirect

Content
View full analysis
/dev/null } ``` The destination and credential are initialized from unrestricted environment variables at `scripts/poll-tasks.sh:8-9`: ```bash SC_API_URL="${SC_API_URL:?SC_API_URL not set}" SC_API_KEY="${SC_API_KEY:?SC_API_KEY not set}" ``` ### Technical Analysis The polling script attaches `SC_API_KEY` to requests sent to the environment-controlled `SC_API_URL`. It does not require HTTPS, validate the hostname, restrict ports, or compare the configured origin to an allowlist. The `-L` option also instructs `curl` to follow redirects. Although curl commonly avoids forwarding authentication headers across different hosts by default, relying on implicit client behavior is not an adequate origin-validation control. Same-origin redirects, DNS compromise, configuration tampering, or client/version-specific behavior can still expose the key or route authenticated requests to an unintended service. Network communication with Squad Control is required by the declared functionality. However, sending a reusable API key to any environment-selected URL without transport and destination validation exceeds the minimum safe privilege needed for that communication. ### Attack Path 1. An attacker modifies the OpenClaw environment or configuration containing `SC_API_URL`, or compromises the configured endpoint or DNS resolution. 2. `poll-tasks.sh` runs automatically through the documented cron flow. 3. `fetch_json` cons ...[truncated 814 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:371
Finding

Remote Task Values Are Interpolated into Shell Commands Without Strict Validation

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:363
Finding

GitHub Personal Access Token Is Exposed in Agent Prompts and Process Arguments

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (27)

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The skill is explicitly designed to ingest and propagate high-value credentials, including an account-scoped Squad Control API key and a GitHub token that may be returned by the remote API and then injected into spawned agent prompts. Exposing those secrets to sub-agents and prompt content materially increases the attack surface for credential leakage through logs, prompt injection, thread content, or unintended outbound calls.

Content

Scanner excerpt · SKILL.md (reported line 17)May include surrounding context.

md
required: true
  GITHUB_TOKEN:
    description: >
      GitHub Personal Access Token for PR creation and repo cloning.
      When not set manually, the skill uses the token returned by the Squad Control API
      (workspace.githubToken) — configured in Squad Control Settings → Project Repository.
    required: false

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/setup.md (reported line 94)May include surrounding context.

md
If your workspace repository is private:

1. Go to **Settings → Project Repository → GitHub Personal Access Token**
2. Generate a fine-grained PAT at https://github.com/settings/tokens with:
   - **Contents**: Read and write
   - **Pull requests**: Read and write

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 37)May include surrounding context.

md
Use when:
  - A cron fires to check for pending tasks
  - You need to pick up, dispatch, or complete a kanban task
  - You need to create a PR and route it for code review
  - You need to spawn a sub-agent to work on an assigned task
  - You need to report task success or failure back to Squad Control
  - You need to create tasks programmatically (break down work)

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 96)May include surrounding context.

md
> Then reply `HEARTBEAT_OK` and exit. The main session has `sessions_spawn` and will handle dispatch.

Alternatively, call the APIs directly:
- Pending: `curl -sL "${SC_API_URL}/api/tasks/pending" -H "x-api-key: ${SC_API_KEY}"`
- Review: `curl -sL "${SC_API_URL}/api/tasks/list?status=review" -H "x-api-key: ${SC_API_KEY}"`

Parse workspace config from the response (see **Multi-Workspace Response Handling** below).

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 231)May include surrounding context.

Idempotency guard before creating a review task:

  1. Search existing tasks for one already referencing this PR URL/number in review|assigned|working
  2. Only create a new review task if none exists
bash
# Create a review task for Hawk

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 235)May include surrounding context.

bash
# Create a review task for Hawk
curl -sL -X POST "${SC_API_URL}/api/tasks/create" \
  -H "x-api-key: ${SC_API_KEY}" -H "Content-Type: application/json" \
  -d "{\"title\": \"Review PR #${PR_NUMBER}: ${TASK_TITLE}\", \"description\": \"Agent marked task done but PR is still open and unmerged. Please review and merge if approved.\\n\\nPR: ${PR_URL}\", \"assignedAgentId\": \"${REVIEWER_AGENT_ID}\", \"workspaceId\": \"${WORKSPACE_ID}\", \"priority\": \"high\"}"

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

The skill instructs the agent to send ${summary} and task metadata directly into a GitHub PR body. Because task descriptions and generated summaries may contain sensitive internal details from Squad Control threads or private repo work, this creates a real risk of unintended data disclosure to GitHub, especially if repository visibility, forks, or external collaborators are broader than the task system's audience.

Content

Scanner excerpt · SKILL.md (reported line 399)May include surrounding context.

md
curl -sL -X POST \
  -H "Authorization: token ${GITHUB_TOKEN}" \
  -H "Content-Type: application/json" \
  "https://api.github.com/repos/${owner}/${repo}/pulls" \
  -d '{"title": "${task.title}", "head": "task/${task._id}", "base": "${SC_DEFAULT_BRANCH:-${WORKSPACE_DEFAULT_BRANCH:-main}}", "body": "${summary}"}'
# Save the PR number and URL from the response

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The later 'On Completion' section allows direct /complete when no reviewer exists, which contradicts the earlier mandatory rule that PR-based work must always transition via /api/tasks/set-review. In practice, this ambiguity can cause agents to mark tasks done while a PR remains open, bypassing intended review controls and weakening change-management integrity.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/advanced-flows.md (reported line 10)May include surrounding context.

Check 1 — Tasks stuck in "working" with a PR deliverable

bash
curl -sL "${SC_API_URL}/api/tasks/list?status=working" -H "x-api-key: ${SC_API_KEY}"

For each working task where:

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/advanced-flows.md (reported line 58)May include surrounding context.

Idempotency guard: Search for existing review task referencing this PR in review|assigned|working state before creating a new one.

bash
curl -sL -X POST "${SC_API_URL}/api/tasks/create" \
  -H "x-api-key: ${SC_API_KEY}" -H "Content-Type: application/json" \
  -d "{\"title\": \"Review PR #${PR_NUMBER}: ${TASK_TITLE}\", \
      \"description\": \"Agent marked task done but PR is still open and unmerged. Please review and merge if approved.\\n\\nPR: ${PR_URL}\", \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This workflow performs an automated git merge into the repository's default branch and pushes it upstream, which is a state-changing, potentially destructive action. In a skill/reference document for agents, the absence of strong preconditions, explicit approval requirements, branch protection checks, and prominent warnings makes accidental unauthorized merges materially likely.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/advanced-flows.md (reported line 129)May include surrounding context.

md
## Full Common Mistakes Reference

1. **Marking done without doing work** — Always post results to thread and create a PR (code tasks) before marking complete.
2. **Sub-agent calling /complete instead of /set-review after PR** — Most common violation. PR opened → `set-review` only. Stuck task recovery now auto-catches "done" tasks with open PRs.
3. **Squad Lead skipping merge** — When task assigned to Squad Lead with PR deliverable, merge to main BEFORE marking complete.
4. **Not passing SC_API_URL/SC_API_KEY into spawn prompt** — Sub-agents can't call back without these. Always include.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The API reference explicitly documents returning a githubToken inside task and pickup responses, which exposes a live credential to any client able to call these endpoints. In the context of an agent-control platform, this is especially dangerous because the token likely grants repository access and could be leaked through logs, prompts, thread messages, or compromise of a less-trusted agent consuming the API.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documentation states that account-scoped keys can list and poll tasks across all workspaces, which significantly broadens data exposure and increases blast radius if such a key is misused or compromised. In this skill context, that danger is amplified because the same cross-workspace task payloads may also embed workspace configuration, creating an aggregation point for sensitive operational data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The API reference explicitly documents that task and workspace responses include a raw githubToken, normalizing the practice of distributing repository credentials through broad task-fetch and pickup endpoints. If these responses are logged, cached, exposed to unintended agents, or retrievable with account-scoped keys, an attacker could gain direct access to source code repositories and potentially modify code or exfiltrate private data.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 225)May include surrounding context.

Example API Call

bash
curl -s -X POST "https://api.github.com/repos/${OWNER}/${REPO}/pulls" \
  -H "Authorization: token ${GITHUB_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 485)May include surrounding context.

Example API Call

bash
curl -s -X POST "https://api.github.com/repos/${OWNER}/${REPO}/pulls" \
  -H "Authorization: token ${GITHUB_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 494)May include surrounding context.

Example API Call

bash
curl -s -X POST "https://api.github.com/repos/${OWNER}/${REPO}/pulls" \
  -H "Authorization: token ${GITHUB_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/advanced-flows.md (reported line 50)May include surrounding context.

Example API Call

bash
curl -s -X POST "https://api.github.com/repos/${OWNER}/${REPO}/pulls" \
  -H "Authorization: token ${GITHUB_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/pr-template.md (reported line 34)May include surrounding context.

Example API Call

bash
curl -s -X POST "https://api.github.com/repos/${OWNER}/${REPO}/pulls" \
  -H "Authorization: token ${GITHUB_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/pr-template.md (reported line 34)May include surrounding context.

Example API Call

bash
curl -s -X POST "https://api.github.com/repos/${OWNER}/${REPO}/pulls" \
  -H "Authorization: token ${GITHUB_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The guide instructs users to store an API key in a local config file but does not warn that this places a reusable secret at rest on disk. If the host is multi-user, backed up insecurely, or compromised by malware or another local process, the key could be extracted and used to access Squad Control resources.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The guide states that agents will automatically receive a GitHub personal access token for private repositories without clearly warning about the consequences of handing a write-capable credential to automated agents. If an agent is compromised, misprompted, or logs/exposes the token, it could be abused to read private code, push malicious commits, alter pull requests, or move laterally within repository workflows.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
78% confidence
Finding

This markdown file documents that githubToken is returned by the API and should be read from the API response, and also references environment-variable-based configuration. Because markdown files should warn about behaviors affecting privacy or sensitive data handling, the absence of any caution about secret handling, logging avoidance, or secure storage is a missing user warning.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.