Back to skill

Security audit

Intelligent Router Openclaw

Security checks for vulnerabilities and agentic risk

Overview

This routing skill has a coherent cost-optimization purpose, but it also makes persistent agent-rule changes, can set up hourly automation, and performs credentialed live provider probes that need review before installation.

Install only if you want this skill to persistently influence future agent model selection. Review the AGENTS.md patch before running install.sh, avoid enabling the hourly cron unless you accept repeated live provider probes and config rewrites, and validate provider base URLs before using discovery with real API keys.

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 (3)

T01 · Skill Instruction Hijacking

Error
Location
install.sh:8
Finding

Persistent modification of global Agent instructions

Content
View full analysis
/dev/null || echo $HOME/clawd)/AGENTS.md" MARKER="## Sub-Agent Spawning Protocol" if grep -q "$MARKER" "$AGENTS_FILE"; then echo "✅ Sub-Agent Spawning Protocol already present in AGENTS.md" echo " Update manually if needed." else echo "📝 Injecting enforcement protocol into AGENTS.md..." cat >> "$AGENTS_FILE" << 'BLOCK' ## Sub-Agent Spawning Protocol **Before spawning sub-agents, classify the task for optimal model selection:** 1. **Run classification:** ```bash python3 skills/intelligent-router/scripts/router.py classify "task description" ``` 2. **Use recommended model in sessions_spawn:** ```python sessions_spawn( task="task description", model="", label="descriptive-label" ) ``` 3. **Or use the spawn helper (shows command, doesn't execute):** ```bash python3 skills/intelligent-router/scripts/spawn_helper.py "task description" ``` **Why this matters:** - Saves 80-95% on costs by using cheaper models for simple tasks - Preserves quality by using premium models for complex work - Automatic fallback chains if primary model fails **Tier guidelines:** - **SIMPLE** (monitoring, checks, summaries) → `ollama/glm-4.7-flash` (FREE local), fallback: GLM-4.7 via proxy - **MEDIUM** (code fixes, research, patches) → DeepSeek V3.2, Llama 3.3 70B - **COMPLEX** (features, architecture, debugging) → Sonnet 4.5, Gemini 3 Pro - **REASONING** (proofs, formal logic) → DeepSeek R1 32B, QwQ 32B - **CRITICAL** (security, production) → Opus 4.6 ⚠️ **MANDATORY: Always set `model` in cron job payloads.** No model = Sonnet default = expensive waste. Sonnet must NEVER be used for monitoring or simple tasks. **Don't guess** — let the router classify ...[truncated 2191 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/discover_models.py:72
Finding

Provider credentials are transmitted to unvalidated configurable endpoints

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/setup_discovery_cron.sh:9
Finding

Predictable shared temporary file permits symlink and race attacks

Content
View full analysis
/tmp/model-discovery-cron.json << 'EOF' { "name": "Model Discovery Refresh", "schedule": { "kind": "every", "everyMs": 3600000 }, "payload": { "kind": "systemEvent", "text": "Run: bash skills/intelligent-router/scripts/auto_refresh_models.sh", "model": "ollama/glm-4.7-flash" }, "sessionTarget": "main", "enabled": true } EOF # Add cron job if command -v openclaw &> /dev/null; then openclaw cron add --job /tmp/model-discovery-cron.json echo "✓ Cron job added: Model Discovery Refresh (every hour)" rm /tmp/model-discovery-cron.json else echo "⚠️ OpenClaw CLI not found. Please run manually:" echo " openclaw cron add --job /tmp/model-discovery-cron.json" fi ``` ### Technical Analysis The setup script uses the fixed, globally predictable path `/tmp/model-discovery-cron.json`. Shell output redirection follows symbolic links. On a multi-user system, another local user can pre-create that path as a symlink to a file writable by the victim, causing the script to overwrite the symlink target. There is also a time-of-check/time-of-use window between writing the JSON and passing its path to `openclaw cron add`. A local attacker may replace or modify the file during this interval, causing an attacker-selected cron definition to be submitted instead of the intended payload. The script does not use atomic exclusive creation, restrictive temporary-file permissions, ownership verification, or a cleanup trap. ### Attack Path #### Symlink overwrite 1. A local attacker predicts that the victim will run the setup script. 2. The attacker creates `/tmp/model-discovery-cron.json` as a symbolic link to a file writable by the victim. 3. The victim runs `setup_discovery_cron.sh`. 4. `cat > /tmp/model-discovery-cron.json` fo ...[truncated 1040 chars]
Remediation
View remediation
"$tmp_file" <<'EOF' { "name": "Model Discovery Refresh", "schedule": { "kind": "every", "everyMs": 3600000 }, "payload": { "kind": "systemEvent", "text": "Run: bash skills/intelligent-router/scripts/auto_refresh_models.sh", "model": "ollama/glm-4.7-flash" }, "sessionTarget": "main", "enabled": true } EOF openclaw cron add --job "$tmp_file" ``` 3. Keep the cleanup trap active on success and failure. 4. If supported by the CLI, pass the job JSON through standard input to eliminate the filesystem race entirely. 5. Do not leave a temporary payload behind when the OpenClaw CLI is unavailable; instead print the JSON or save it only to an explicitly user-selected path. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (27)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill includes instructions to create persistent hourly cron jobs and system-event automation, yet it is described as a routing skill rather than an automation installer. Persistent scheduled execution is materially more dangerous because it can continue making network calls and mutating config long after the initial install.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill includes instructions to create persistent hourly cron jobs and system-event automation, yet it is described as a routing skill rather than an automation installer. Persistent scheduled execution is materially more dangerous because it can continue making network calls and mutating config long after the initial install.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill includes instructions to create persistent hourly cron jobs and system-event automation, yet it is described as a routing skill rather than an automation installer. Persistent scheduled execution is materially more dangerous because it can continue making network calls and mutating config long after the initial install.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill includes instructions to create persistent hourly cron jobs and system-event automation, yet it is described as a routing skill rather than an automation installer. Persistent scheduled execution is materially more dangerous because it can continue making network calls and mutating config long after the initial install.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill includes instructions to create persistent hourly cron jobs and system-event automation, yet it is described as a routing skill rather than an automation installer. Persistent scheduled execution is materially more dangerous because it can continue making network calls and mutating config long after the initial install.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/setup_discovery_cron.sh (reported line 30)May include surrounding context.

sh
if command -v openclaw &> /dev/null; then
    openclaw cron add --job /tmp/model-discovery-cron.json
    echo "✓ Cron job added: Model Discovery Refresh (every hour)"
    rm /tmp/model-discovery-cron.json
else
    echo "⚠️  OpenClaw CLI not found. Please run manually:"
    echo "   openclaw cron add --job /tmp/model-discovery-cron.json"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README explicitly encourages routing tasks such as security audits, authentication work, production, and financial operations to external LLM providers, but it does not warn that task content may contain sensitive code, secrets, customer data, or regulated information. In an agent-routing skill, this omission is materially risky because users may follow the documented patterns and send high-stakes data to third-party APIs without informed consent, data minimization, or provider risk review.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises executable shell commands, network-based model discovery, and file modifications, but declares no explicit tool scope or permissions boundary. In a system that relies on metadata for review or sandboxing, this creates a transparency and governance gap that can lead to over-privileged execution of a supposedly simple routing skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Modifying AGENTS.md lets the skill alter the agent's operating rules and persist those changes in repository context. Because this capability is unrelated to mere model selection, it represents an unjustified governance-control surface that can silently shape downstream agent decisions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Patching AGENTS.md changes the instruction hierarchy and can permanently influence future agent behavior across the repository. A routing skill does not inherently need to rewrite governance files, so this self-integration behavior creates a privileged persistence mechanism that could be abused or cause hard-to-audit policy drift.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The auto-discovery feature performs broad provider scanning and live inference tests across configured models, which is much more invasive than simple local routing logic. In context, this expands the skill into a network reconnaissance and service-validation tool, increasing data exposure, API usage, and unintended outbound interactions.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Live inference testing against all configured providers constitutes broad outbound probing and may leak prompts, consume paid quota, and touch services the operator did not intend to test. For a routing skill, that is an unnecessary expansion of capability unless tightly scoped and explicitly authorized.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The auto-update workflow states that config will be updated with working models only, but it does not clearly warn that unavailable models may be removed and tier assignments rebuilt. Silent configuration rewrites can break expected routing behavior or remove intentionally configured models, especially in production automation.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
### Benefits

✅ **Self-healing:** Automatically removes broken models (e.g., expired OAuth)
✅ **Zero maintenance:** No manual model list updates
✅ **New models:** Auto-adds newly released models
✅ **Cost optimization:** Always uses cheapest working model per tier

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The installer appends content directly into a repository-wide AGENTS.md file, changing agent operating guidance rather than only installing a routing utility. Because AGENTS.md can influence future agent behavior across the repo, this creates a persistence and policy-modification risk that exceeds the advertised purpose and can silently alter how later tasks are executed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script writes to AGENTS.md without any confirmation prompt, dry-run, backup, or diff display. In a security-sensitive agent environment, silent modification of instruction files can unexpectedly change future automated behavior and makes it easier for a user to install policy changes they did not fully review.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/router_policy.py (reported line 76)May include surrounding context.

python
def classify_task(task: str) -> str:
    """Call router.py to classify a task. Returns tier string."""
    result = subprocess.run(
        [sys.executable, str(SKILL_DIR / "scripts" / "router.py"), "classify", task],
        capture_output=True, text=True
    )

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest describes an intelligent router for choosing an optimal model for sub-agent task delegation based on complexity, cost, and capability. This file also enumerates and audits all current cron jobs via the openclaw cron list --json command, which is broader operational inspection of scheduler state rather than just routing or recommendation logic.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/router_policy.py (reported line 182)May include surrounding context.

python
Reads crons via openclaw CLI.
    """
    try:
        result = subprocess.run(
            ["openclaw", "cron", "list", "--json"],
            capture_output=True, text=True, timeout=15
        )

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The manifest frames the skill as selecting the best model for delegation tasks, but cmd_audit executes the external openclaw CLI to inspect all cron jobs. External command execution and platform-wide job enumeration are stronger capabilities than simple model selection and are not obviously required by the stated purpose alone.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/spawn_helper.py (reported line 150)May include surrounding context.

python
User override: coding tasks always route to COMPLEX (Sonnet 4.6 per tier_overrides).
    """
    result = subprocess.run(
        [sys.executable, str(SCRIPT_DIR / "router.py"), "classify", task_description],
        capture_output=True, text=True, check=True
    )

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The installation text says to run an install script that patches AGENTS.md, but does not prominently warn that repository instructions will be modified. This is dangerous mainly from a safety and review standpoint: users may execute it without understanding that it creates persistent behavioral changes.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The file header says the installer 'Patches AGENTS.md with the mandatory enforcement protocol,' implying strict enforcement behavior. However, the inserted block includes an optional helper that 'shows command, doesn't execute,' making the documentation portray the change as stronger and more enforcing than what the code actually implements.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This code performs a file write to the router configuration, replacing model entries and routing data, but the write operation itself has no inline confirmation prompt or warning comment near the action. Although the CLI flag name suggests an update, the code path is still modifying a user-relevant config file and would be safer with a clearer user-facing disclosure immediately before the write.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The script writes a JSON results file to a user-supplied or default path, but there is no prior disclosure that an existing file may be overwritten. For a code-file warning review, this is a file write lacking an inline warning or confirmation at the operation site.

Content

No source excerpt is available for this finding.