Back to skill

Security audit

FlowSwarm — Swarm Coding Framework for OpenClaw

Security checks for vulnerabilities and agentic risk

Overview

The skill is broadly coherent as a multi-agent coding orchestrator, but it grants and persists unusually broad Claude/MCP authority without enough scoping or user control.

Review this skill carefully before installing. Use it only in a disposable or well-isolated development environment, pin the RuFlo package version, avoid `--permission-mode bypassPermissions`, inspect `.mcp.json` before and after setup, and do not let the setup script enable unrelated MCP servers or start background services unless you explicitly want that persistent behavior.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:153
Finding

Claude Code Is Launched with Permission Safeguards Disabled

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:153-159
Vulnerability Type: Permission-safeguard bypass through Skill instructions
Risk Level: Critical

Vulnerable Code

python
# Launch (ALWAYS background, NEVER nohup)
exec(
  command='cd /project && claude --permission-mode bypassPermissions --mcp-config .mcp.json --print "SWARM MODE: ... TASK: ..."',
  background=True,
  timeout=300
)

Technical Analysis

The documented launch command explicitly sets Claude Code to bypassPermissions mode. This removes its normal interactive authorization boundary while simultaneously loading a project-controlled .mcp.json configuration.

The swarm task is intentionally open-ended and may inspect files, modify source code, and invoke shell or MCP tools. Disabling permission checks is not necessary for orchestration and grants the Agent substantially more authority than required. Repository instructions, hooks, prompt content, or an enabled MCP server could therefore induce sensitive operations without explicit user approval.

This is classified primarily as T01: Skill Instruction Hijacking because the Skill instructs the Agent to weaken its current-session safety constraints. It also constitutes T05: Unauthorized Access and Privilege Escalation because it violates least privilege.

Attack Path

  1. A user runs the command recommended by the Skill in a target repository.
  2. Claude Code loads the repository's .mcp.json, hooks, instructions, and other project context.
  3. The bypassPermissions mode suppresses normal approval prompts.
  4. Malicious repository instructions or an MCP tool request a sensitive command, file write, or other privileged operation.
  5. Claude Code executes the operation with the invoking user's operating-system privileges and without the expected interactive authorization.

Impact Assessment

Exploitation could permit operations available to the local user, includ ...[truncated 366 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove --permission-mode bypassPermissions from every documented execution pattern.
  • Use Claude Code's default permission mode and retain interactive confirmation for sensitive operations.
  • If automation requires preauthorization, define a minimal allowlist limited to necessary repository-local reads and writes.
  • Require explicit approval for shell execution, network access, writes outside the target repository, credential access, and MCP tool invocation.
  • Validate and review .mcp.json before loading it.
  • Run untrusted projects in an isolated container or restricted operating-system account with no production credentials.
  • Document the exact files and commands the swarm is expected to use rather than granting unrestricted authority.

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/setup-flow-swarm.sh:257
Finding

Mutable Third-Party Package Is Downloaded and Executed Without Version Pinning

Content
View full analysis

Vulnerability Details

File Location: scripts/setup-flow-swarm.sh:257-273; related instructions at SKILL.md:91-93
Vulnerability Type: Unpinned remote dependency retrieval and execution
Risk Level: High

Vulnerable Code

bash
# --- Step 2: Install RuFlo ---
if [[ "$INIT_ONLY" == false ]]; then
  info "Installing RuFlo globally..."
  if command -v ruflo >/dev/null 2>&1; then
    CURRENT=$(ruflo --version 2>/dev/null || echo "unknown")
    ok "RuFlo already installed ($CURRENT), updating..."
  fi
  npm install -g ruflo@latest 2>&1 | tail -3
  ok "RuFlo $(ruflo --version 2>/dev/null)"

  # --- Step 3: Register MCP ---
  info "Registering RuFlo MCP server..."
  MCP_CHECK=$(claude mcp list 2>/dev/null || true)
  if echo "$MCP_CHECK" | grep -qi "ruflo\|claude-flow"; then
    ok "RuFlo MCP already registered"
  else
    claude mcp add ruflo -- npx -y ruflo@latest mcp start 2>&1
    ok "RuFlo MCP registered"
  fi
fi

The corresponding manual instructions are:

bash
npm install -g ruflo@latest
claude mcp add ruflo -- npx -y ruflo@latest mcp start
cd /path/to/project && ruflo init && ruflo memory init && ruflo daemon start

Technical Analysis

The mutable latest tag does not identify a fixed, audited package release. The code retrieved during a future installation or MCP startup can therefore differ from the code reviewed with this Skill.

The global installation executes package lifecycle behavior with the invoking user's privileges. The registered MCP command additionally uses npx -y, which automatically accepts package retrieval and execution without interactive review. Because the MCP registration retains ruflo@latest, later server starts may execute a newly published release even when the setup script itself has not changed.

This creates both an insecure dependency risk and a remote payload retrieval channel whose eff ...[truncated 1130 chars]

Remediation
View remediation

Remediation Suggestions

  • Replace every ruflo@latest reference with an exact, reviewed version.
  • Pin and verify package integrity using a lockfile, trusted checksum, signature, or equivalent provenance control.
  • Avoid global installation where possible; install into a dedicated, isolated project or tool directory.
  • Do not register an MCP command that dynamically retrieves packages through npx -y.
  • Register a fixed local executable from the verified installation instead.
  • Disable package lifecycle scripts during acquisition where feasible, then explicitly review any required installation scripts.
  • Require deliberate user approval before upgrades rather than automatically updating an existing installation.
  • Run the MCP server in a sandbox with restricted filesystem, credential, and network access.

T07 · Tool Hijacking and Spoofing

Error
Location
scripts/setup-flow-swarm.sh:289
Finding

Setup Script Silently Enables Every MCP Server in the Project Configuration

Content
View full analysis

Vulnerability Details

File Location: scripts/setup-flow-swarm.sh:289-300
Vulnerability Type: Indiscriminate activation of project-controlled MCP tools
Risk Level: High

Vulnerable Code

bash
# CRITICAL: Fix autoStart (ruflo init defaults to false, which disables ALL MCP tools)
if [[ -f ".mcp.json" ]]; then
  if grep -q '"autoStart": false' ".mcp.json" 2>/dev/null; then
    python3 -c "
import json
with open('.mcp.json') as f: d = json.load(f)
for srv in d.get('mcpServers', {}).values():
    if srv.get('autoStart') == False:
        srv['autoStart'] = True
with open('.mcp.json', 'w') as f: json.dump(d, f, indent=2)
" 2>/dev/null && ok "Fixed autoStart: false → true (enables 150+ MCP tools)" || warn "Could not fix autoStart"
  else
    ok "MCP autoStart already enabled"
  fi
fi

Technical Analysis

The stated purpose is to enable the RuFlo MCP server. However, the implementation iterates over every entry in mcpServers and changes all explicitly disabled servers from false to true.

The script does not validate server names, executable paths, arguments, origins, or trust status. As a result, unrelated servers that a repository owner deliberately disabled—including project-controlled command entries—are silently activated.

This expands the Agent's tool surface beyond the capability declared by the Skill and can convert an inert malicious MCP configuration into an executable one.

Attack Path

  1. An attacker supplies or modifies a target repository containing .mcp.json.
  2. The file includes an attacker-controlled MCP server with "autoStart": false, making it appear inactive during casual review.
  3. The user runs setup-flow-swarm.sh against that repository.
  4. The Python loop changes the malicious server's autoStart property to true along with the intended RuFlo entry.
  5. A subsequent Claude Code session loads the project MCP configuration.
  6. T ...[truncated 658 chars]
Remediation
View remediation

Remediation Suggestions

  • Modify only the specifically expected RuFlo server key.
  • Validate that the selected entry has the expected command, executable path, package version, and arguments before enabling it.
  • Preserve the state of all unrelated MCP entries.
  • Display the proposed configuration change and request explicit user approval before enabling auto-start.
  • Reject ambiguous configurations containing multiple RuFlo-like entries instead of matching broadly.
  • Back up .mcp.json before modification and perform the update atomically.
  • Use logic equivalent to:
python
server = d.get("mcpServers", {}).get("claude-flow")
if server is None:
    raise RuntimeError("Expected RuFlo MCP server is missing")
server["autoStart"] = True
  • Where the actual registered key is ruflo, use that exact key consistently rather than modifying every server.
  • Review project-controlled MCP configurations before launching Claude Code, particularly for untrusted repositories.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (24)

MCP Config Access

High
Category
Agent Snooping
Confidence
95% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

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

bash
# Check current state
python3 -c "import json; d=json.load(open('.mcp.json')); print('autoStart:', d['mcpServers']['claude-flow'].get('autoStart'))"

# Enable (REQUIRED for full swarm functionality)
python3 -c "

MCP Config Access

High
Category
Agent Snooping
Confidence
95% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

Scanner excerpt · scripts/setup-flow-swarm.sh (reported line 216)May include surrounding context.

sh
```bash
# Check current state
python3 -c "import json; d=json.load(open('.mcp.json')); print('autoStart:', d['mcpServers']['claude-flow'].get('autoStart'))"

# Enable (REQUIRED for full swarm functionality)
python3 -c "

MCP Config Access

High
Category
Agent Snooping
Confidence
95% confidence
Finding

This command rewrites .mcp.json to force autoStart: true, causing the MCP server to start automatically in future sessions. Enabling automatic startup expands the trusted code that runs in the environment and can persist beyond the immediate task, increasing risk from compromised tooling, unsafe server behavior, or user unawareness.

Content

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

md
# Enable (REQUIRED for full swarm functionality)
python3 -c "
import json
with open('.mcp.json') as f: d = json.load(f)
d['mcpServers']['claude-flow']['autoStart'] = True
with open('.mcp.json', 'w') as f: json.dump(d, f, indent=2)
print('MCP autoStart enabled')

MCP Config Access

High
Category
Agent Snooping
Confidence
95% confidence
Finding

This line is part of the same config-modifying snippet and performs the actual write-back to .mcp.json, persisting automatic MCP execution. Persistent config modification is more dangerous in this skill because it is paired with background execution and unpinned package/tool installation guidance, creating a durable trust expansion in the developer environment.

Content

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

import json with open('.mcp.json') as f: d = json.load(f) d['mcpServers']['claude-flow']['autoStart'] = True with open('.mcp.json', 'w') as f: json.dump(d, f, indent=2) print('MCP autoStart enabled') "

text

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly instructs use of claude --permission-mode bypassPermissions, which suppresses normal safety gates for command/tool execution. In combination with this skill's setup steps, background execution, config writes, and package installation, that substantially increases the blast radius of mistakes, prompt injection, or accidental activation.

Content

No source excerpt is available for this finding.

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · scripts/setup-flow-swarm.sh (reported line 174)May include surrounding context.

sh
info "Project: $PROJECT_DIR"

    TOTAL=$((TOTAL + 1))
    if [[ -f "$PROJECT_DIR/.claude/settings.json" ]]; then
      if grep -q "hook-handler\|claude-flow\|ruflo" "$PROJECT_DIR/.claude/settings.json" 2>/dev/null; then
        ok "Claude hooks configured"
        PASS=$((PASS + 1))

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · scripts/setup-flow-swarm.sh (reported line 175)May include surrounding context.

sh
info "Project: $PROJECT_DIR"

    TOTAL=$((TOTAL + 1))
    if [[ -f "$PROJECT_DIR/.claude/settings.json" ]]; then
      if grep -q "hook-handler\|claude-flow\|ruflo" "$PROJECT_DIR/.claude/settings.json" 2>/dev/null; then
        ok "Claude hooks configured"
        PASS=$((PASS + 1))

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · scripts/setup-flow-swarm.sh (reported line 202)May include surrounding context.

sh
fi

    TOTAL=$((TOTAL + 1))
    AGENT_COUNT=$(find "$PROJECT_DIR/.claude/agents/" -name "*.md" 2>/dev/null | wc -l | tr -d ' ')
    if [[ "$AGENT_COUNT" -gt 0 ]]; then
      ok "Agent definitions: $AGENT_COUNT"
      PASS=$((PASS + 1))

MCP Config Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

Scanner excerpt · scripts/setup-flow-swarm.sh (reported line 211)May include surrounding context.

sh
fi

    TOTAL=$((TOTAL + 1))
    if grep -q '"autoStart": true' "$PROJECT_DIR/.mcp.json" 2>/dev/null; then
      ok "MCP autoStart: true (150+ tools enabled)"
      PASS=$((PASS + 1))
    else

MCP Config Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

Scanner excerpt · scripts/setup-flow-swarm.sh (reported line 292)May include surrounding context.

sh
# CRITICAL: Fix autoStart (ruflo init defaults to false, which disables ALL MCP tools)
  if [[ -f ".mcp.json" ]]; then
    if grep -q '"autoStart": false' ".mcp.json" 2>/dev/null; then
      python3 -c "
import json
with open('.mcp.json') as f: d = json.load(f)

MCP Config Access

High
Category
Agent Snooping
Confidence
95% confidence
Finding

The embedded Python code reads .mcp.json and programmatically modifies server settings, enabling autoStart for all MCP servers with that field set to false. Because this broadens automatic tool execution in future Claude sessions, silent config mutation increases the attack surface and may activate tools the user intentionally disabled.

Content

Scanner excerpt · scripts/setup-flow-swarm.sh (reported line 295)May include surrounding context.

sh
if grep -q '"autoStart": false' ".mcp.json" 2>/dev/null; then
      python3 -c "
import json
with open('.mcp.json') as f: d = json.load(f)
for srv in d.get('mcpServers', {}).values():
    if srv.get('autoStart') == False:
        srv['autoStart'] = True

MCP Config Access

High
Category
Agent Snooping
Confidence
95% confidence
Finding

Writing the modified .mcp.json back to disk persists a behavioral change that can automatically start MCP servers in later sessions. Persistent config changes affecting code-executing toolchains are security-relevant because they alter trusted execution behavior beyond the current run.

Content

Scanner excerpt · scripts/setup-flow-swarm.sh (reported line 299)May include surrounding context.

sh
for srv in d.get('mcpServers', {}).values():
    if srv.get('autoStart') == False:
        srv['autoStart'] = True
with open('.mcp.json', 'w') as f: json.dump(d, f, indent=2)
" 2>/dev/null && ok "Fixed autoStart: false → true (enables 150+ MCP tools)" || warn "Could not fix autoStart"
    else
      ok "MCP autoStart already enabled"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill documents commands that modify project state and configuration, including writing .mcp.json, running setup scripts, and generating tests/files, but it declares no explicit tool scope or allowed-tools boundary. In an agent-skill context, missing scope increases the chance that the runtime grants broader file-write capability than users expect, enabling unintended repository or config changes.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases include generic language such as swarm this and use the swarm, which can be invoked accidentally during ordinary collaboration. Broad triggers are risky here because the skill is powerful: it recommends multi-agent execution, file generation, setup scripts, background processes, and config changes.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

The skill instructs launching an MCP server via npx -y ruflo@latest mcp start and references an unpinned npx -y ruflo pattern, which pulls and executes code at install/runtime without version pinning. That creates a supply-chain risk: a compromised upstream package or breaking release could execute arbitrary code in the user's environment.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

L505 states as a fixed fact that --print mode doesn't persist swarm memories. However, the rest of the file repeatedly instructs use of claude --print --mcp-config .mcp.json together with memory_store, and explicitly says the root cause of missing memory was MCP autostart being disabled rather than --print itself (for example L16, L114, L182-L189, L463-L468, L493). This is an active contradiction in the skill's own documentation about whether memory persistence works in the documented execution mode.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The meta-template explicitly instructs the agent to inspect local git history, daemon logs, and production test results, then rewrite the skill based on that data. That expands the skill from orchestration into self-modification plus broad local data inspection, which can expose sensitive repository history, operational logs, or embedded secrets without clear user consent or scoping.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The template directs collection of git log data and daemon logs from the local environment without any user-facing warning that sensitive project history, credentials, tokens, or internal operational details may be accessed. In an agent skill, silent expansion of data access scope is dangerous because users may invoke the template for improvement work without realizing it authorizes inspection of unrelated local artifacts.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The meta-analysis template instructs the agent to read daemon logs and production test data, both of which commonly contain stack traces, environment details, request payloads, filenames, or secret-bearing diagnostics. This creates a sensitive-data exposure risk because the template normalizes broad inspection of local operational data for prompt generation and analysis.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
97% confidence
Finding

The script registers an MCP server using npx -y ruflo@latest mcp start, which pulls and executes remote package code without pinning to a specific version. This creates a supply-chain risk: a compromised upstream package, malicious publish, or breaking update could cause arbitrary code execution whenever the MCP server is added or started.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script performs a global npm install and registers an MCP server, both of which change the user's environment and trust boundaries, without an explicit confirmation step. Combined with remote package execution, this can have lasting effects beyond the current project and may be unsafe on shared or managed systems.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

This command path registers the MCP server with npx -y ruflo@latest mcp start, causing remote code to be fetched and executed at runtime. Because it is unpinned and automatic, users may unknowingly run newly published or compromised code with their local permissions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script silently rewrites .mcp.json to force autoStart=true, changing project behavior and enabling additional tooling without explicit consent at the moment of modification. In a security-sensitive developer environment, unexpected config mutation can widen the execution surface and violate user expectations or repository policy.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script starts a background daemon automatically after initialization, which can create persistent local processes without clear prior consent. Background services may consume resources, expose IPC/network surfaces, and surprise users in locked-down or audited environments.

Content

No source excerpt is available for this finding.