Back to skill

Security audit

Hive Task Router

Security checks for vulnerabilities and agentic risk

Overview

The skill is a task router with disclosed behavior, but its shell script unsafely executes a writable cache file and prints copyable commands that can be command-injected.

Review this before installing. The router's purpose is clear, but do not use it in an automated flow that executes its printed commands until cache loading is fixed to parse data safely and generated OpenClaw commands are shell-escaped or executed via argument arrays. Avoid shared or attacker-controlled HIVE_CACHE_DIR values, and treat subagent auto-routing as opt-in for sensitive tasks.

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

T09 · Insecure Skill Coding Practices

Error
Location
router.sh:50
Finding

Arbitrary Command Execution Through Sourced Model Cache

Content
View full analysis
"$CACHE_FILE" echo "MODEL_CODE=$MODEL_CODE" >> "$CACHE_FILE" echo "MODEL_WEB=$MODEL_WEB" >> "$CACHE_FILE" echo "MODEL_CHAT=$MODEL_CHAT" >> "$CACHE_FILE" echo "MODEL_DOC=$MODEL_DOC" >> "$CACHE_FILE" echo "MODEL_DATA=$MODEL_DATA" >> "$CACHE_FILE" echo "auto_detected=1" >> "$CACHE_FILE" ``` ```bash load_cached_models() { if [ -f "$CACHE_FILE" ]; then local cache_age=$(($(date +%s) - $(stat -f%m "$CACHE_FILE" 2>/dev/null || stat -c%Y "$CACHE_FILE" 2>/dev/null || echo 0))) if [ "$cache_age" -lt "$CACHE_TTL" ]; then # Load cached configuration source "$CACHE_FILE" 2>/dev/null if [ "$auto_detected" == "1" ]; then echo -e "${BLUE}✅ 使用缓存的模型配置(剩余有效期:$((CACHE_TTL - cache_age)) 秒)${NC}" return 0 fi fi fi return 1 } ``` ### Technical Analysis The model cache is intended to contain data, but it is loaded with the Bash `source` command. `source` does not parse the file as inert configuration data; it executes every shell statement in the file in the current process. The cache path is partially controlled through `HIVE_CACHE_DIR`. The implementation does not verify that the directory and file: - Are owned by the current user. - Are not symbolic links. - Have restrictive permissions. - Contain only approved assignment keys. - Contain values matching an expected model-identifier format. Consequently, anyone able to control `HIVE_CACHE_DIR`, write to the selected cache file, replace it with a sy ...[truncated 1724 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
router.sh:407
Finding

Shell Command Injection in Generated OpenClaw Commands

Content
View full analysis
Remediation
View remediation
&2 return 1 } ``` 4. Do not attempt to secure arbitrary task text by merely removing selected metacharacters. Use argument arrays or a correct serialization mechanism. 5. Clearly distinguish informational output from executable output and warn integrations not to pass generated text through `sh`, `bash -c`, or `eval`. 6. Add regression tests covering quotes, command substitutions, backticks, semicolons, newlines, backslashes, and leading hyphens in task input. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · config.md (reported line 502)May include surrounding context.

~/.hive-config echo "export HIVE_MODEL_WEB="$HIVE_MODEL_WEB"" >> ~/.hive-config echo "export HIVE_MODEL_CHAT="$HIVE_MODEL_CHAT"" >> ~/.hive-config echo "export HIVE_MODEL_DOC="$HIVE_MODEL_DOC"" >> ~/.hive-config echo "export HIVE_MODEL_DATA="$HIVE_MODEL_DATA"" >> ~/.hive-config echo "export HIVE_MAX_CONCURRENT="$HIVE_MAX_CONCURRENT"" >> ~/.hive-config

Source it in .bashrc or .zshrc

echo "source ~/.hive-config" >> ~/.bashrc

text

---

## Support

- **Documentation:** See `SKILL.md` for usage examples
- **Issues:** Report bugs or feature requests
- **Contributions:** Pull requests welcome
- **Community:** Join OpenClaw Discord for discussions

---

*Version: 1.0.0*  
*Last Updated: 2026-03-12*  
*Author: qiongcao*  
*Universal Model Support: Yes*

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script executes the cache file with source "$CACHE_FILE", which turns a writable data file into executable shell code. If an attacker can modify the cache path or cache contents—especially since HIVE_CACHE_DIR is environment-controlled—they can achieve arbitrary command execution when model validation runs, which is outside the router's stated task-classification purpose and makes the skill materially more dangerous.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documented user triggers include natural-language phrases like "analyze this task" and "which model should I use for this task," which are broad enough to arise in ordinary discussion rather than as deliberate skill invocations. Although one explicit trigger is specific ("use hive router"), these additional phrases make activation boundaries unclear and increase the chance of unintended routing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The prescribed clarification prompt is entirely in Chinese and is presented as the default agent response for vague tasks, without indicating that the agent should match the user's language or ask for preference. This creates a locale/language policy concern because the skill may force a specific language on users who did not opt in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The keyword configuration examples for all task types are primarily Chinese terms, which implies the router is designed around a specific language. The document does not state that this is a China-specific skill or offer users a language/locale choice, so this appears to enforce a locale preference without opt-in.

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 · config.md (reported line 421)May include surrounding context.

Project-Specific Config

Create .hive-env in your project root:

bash
# .hive-env

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This shell skill presents its purpose, help text, and routing guidance in Chinese, and the natural-language interface appears designed around Chinese prompts without any opt-in or alternate locale path. Under the language/locale policy rule, forcing a specific language without user choice is a policy concern unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.