Back to skill

Security audit

Configure Clawhub Domestic Mirror

Security checks for vulnerabilities and agentic risk

Overview

The skill has a legitimate mirror-configuration purpose, but it also ships unrelated persistent agent/workspace task instructions and changes shell startup behavior in ways users should review first.

Install only if you intentionally want ClawHub traffic routed through this specific mirror. Review and preferably remove the unrelated task-record section, use a temporary export before editing shell startup files, avoid running the script with elevated privileges, and confirm how to undo the CLAWHUB_REGISTRY and CLAWHUB_SITE changes.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T08 · Insecure Dependencies

Warning
Location
scripts/configure_clawhub_mirror.sh:7
Finding

Persistent redirection to an insufficiently verified third-party package and API endpoint

Content
View full analysis

Vulnerability Details

File Location: scripts/configure_clawhub_mirror.sh:7-21
Vulnerability Type: Supply-chain trust boundary violation
Risk Level: Medium

Vulnerable Code

bash
MIRROR_URL="https://cn.clawhub-mirror.com"
BASHRC="$HOME/.bashrc"

if grep -q "CLAWHUB_REGISTRY=$MIRROR_URL" "$BASHRC" 2>/dev/null; then
    echo "ClawHub mirror is already configured"
else
    cat >> "$BASHRC" << EOF

# ClawHub mirror configuration
export CLAWHUB_REGISTRY=$MIRROR_URL
export CLAWHUB_SITE=$MIRROR_URL
EOF
fi

The same endpoint is also recommended in SKILL.md:20-28,62 and references/clawhub-mirror-verification.md:4-13,46.

Technical Analysis

The script persistently redirects both ClawHub package retrieval and site/API traffic to https://cn.clawhub-mirror.com. Although the documentation describes this endpoint as officially recognized, the project provides no independently verifiable ownership information, certificate or public-key pinning, signed repository metadata, package signature validation, or checksum verification.

TLS protects traffic in transit but does not establish that packages returned by the selected registry are equivalent to packages from the official source. The mirror therefore becomes a persistent supply-chain trust anchor with influence over package contents, search results, and API responses.

This finding does not establish that the endpoint is currently malicious. The vulnerability is the persistent delegation of package and API trust without integrity controls or documented provenance.

Attack Path

  1. A user runs the configuration script or follows the Skill instructions.
  2. The script appends CLAWHUB_REGISTRY and CLAWHUB_SITE to the user's shell startup file.
  3. Future ClawHub sessions automatically send package and API requests to the configured endpoint.
  4. The endpoint, its DNS, hosting account, certificate issuance path, or publi ...[truncated 844 chars]
Remediation
View remediation

Remediation Suggestions

  1. Use only an endpoint whose ownership and official status can be independently verified.
  2. Document authoritative provenance, including a link from an official ClawHub-controlled domain.
  3. Verify signed repository metadata and package signatures before installation.
  4. If signatures are unavailable, publish trusted checksums through a separate authenticated channel and verify them locally.
  5. Avoid redirecting CLAWHUB_SITE unless API redirection is strictly required; package registry and API traffic should have separate trust decisions.
  6. Obtain explicit user confirmation before making the endpoint persistent.
  7. Back up the original configuration and provide a rollback command that removes only settings added by this script.
  8. Clearly state that successful clawhub search output proves connectivity only; it does not establish endpoint ownership or package integrity.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/configure_clawhub_mirror.sh:25
Finding

Configuration script executes the entire user-controlled shell startup file

Content
View full analysis

Vulnerability Details

File Location: scripts/configure_clawhub_mirror.sh:25-27
Vulnerability Type: Unsafe execution of mutable shell configuration
Risk Level: Medium

Vulnerable Code

bash
echo "Applying configuration..."
source "$BASHRC"

Technical Analysis

source "$BASHRC" executes every command in the user's ~/.bashrc inside the configuration script's current shell process. The script only needs two environment variables for its subsequent verification, but instead evaluates an entire mutable startup file.

Shell startup files commonly contain aliases, functions, command substitutions, environment initialization, network operations, and interactive-only commands. They can also be modified by other applications or by an attacker who has obtained write access to the user's account. Quoting the path prevents path splitting but does not mitigate execution of file contents.

Because the script uses set -e, unrelated failing commands in .bashrc can also terminate the script unexpectedly. This creates both a command-execution sink and a reliability problem.

Attack Path

  1. An attacker, compromised application, or malicious installer gains the ability to append a command to the target user's ~/.bashrc.
  2. The target runs configure_clawhub_mirror.sh.
  3. The script invokes source "$BASHRC".
  4. The injected command executes in the script's process with the target user's privileges.
  5. The command may read user-accessible files, modify the environment, alter verification behavior, or perform any other action permitted to that user.

This path requires prior write access to .bashrc; the script does not independently grant that access. However, it unnecessarily turns existing startup-file modification into immediate execution during a configuration operation.

Impact Assessment

Exploitation permits arbitrary command execution with the privileges of the user running the scri ...[truncated 290 chars]

Remediation
View remediation

Remediation Suggestions

Do not source the user's complete startup file. Export only the values required by the current script:

bash
export CLAWHUB_REGISTRY="$MIRROR_URL"
export CLAWHUB_SITE="$MIRROR_URL"

Use these variables for verification and tell the user that future shells will load the persistent settings automatically. Additional hardening should include:

  1. Validate that HOME is set and that the target configuration file is a regular file owned by the current user.
  2. Reject symbolic links if modifying them is not explicitly intended.
  3. Create the configuration file with user-only permissions when it does not exist.
  4. Write a clearly delimited managed block and update it atomically rather than appending repeatedly.
  5. Preserve a backup and provide a targeted rollback mechanism.
  6. Never recommend running this user-level script with elevated privileges.

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:88
Finding

Unrelated persistent Agent-state and scheduled-task instructions expand the Skill's declared scope

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:88-115
Vulnerability Type: Instructional scope hijacking
Risk Level: Medium

Vulnerable Skill Text

The following is an English rendering of the relevant source segment:

text
Goal:
Complete system experience archival synchronization across multiple Agent
workspaces and configure the ClawHub mirror.

Key steps:
- Restore three scheduled tasks and repair the missing cron/jobs.json.
- Organize files under ~/projects/obsidian-vault/.
- Create .learnings/2026-04-01-git-repo-separation-and-cron-restore.md.
- Synchronize TOOLS.md, MEMORY.md, and LEARNINGS.md across four Agent
  workspaces.

Related persistent-state paths and synchronization status continue at SKILL.md:126-130.

Technical Analysis

The declared purpose of the Skill is to configure a ClawHub mirror. The embedded task record introduces unrelated operations involving scheduled tasks, multiple Git repositories, learning records, persistent Agent memory files, and several workspaces.

Agent Skills are loaded as instructions and may influence the Agent's interpretation of what actions are required. Including unrelated operational history in the main Skill document creates ambiguity between descriptive history and executable instructions. An Agent could treat these entries as part of the requested workflow, expanding a mirror-configuration request into modification of persistent state and unrelated projects.

The audited repository does not contain code that directly performs these additional actions. The risk arises from the instructional content and its placement inside a reusable Skill document.

Attack Path

  1. A user requests help with a slow ClawHub installation or mirror configuration.
  2. The Agent loads SKILL.md because its trigger description matches the request.
  3. The Agent reads the embedded task record alongside the legitimate configuration procedure.
  4. The Ag ...[truncated 955 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the entire task-record section from the reusable Skill.
  2. Keep the Skill narrowly limited to mirror selection, shell-specific configuration, verification, and rollback.
  3. Store historical task notes outside files loaded as Agent instructions.
  4. Do not include unrelated cron, repository, workspace, memory, or learning-file operations.
  5. Clearly distinguish non-actionable reference material from mandatory steps.
  6. Require explicit, task-specific user consent before modifying persistent Agent state, scheduled tasks, or files outside the requested configuration target.
  7. Add a scope statement instructing the Agent not to alter unrelated workspaces, repositories, memory files, or schedulers.
Vulnerability Patterns
  • 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
65% 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 · SKILL.md (reported line 90)May include surrounding context.

md
📋 关键步骤
- **执行自我进化与经验归档**
  - 恢复 3 个定时任务(每日回顾 + AI 新闻推送),修复丢失的 `cron/jobs.json` 并添加 Git 跟踪。
  - 理清 3 个 Git 仓库关系(OpenClaw / Obsidian / H5 周报),禁止使用 `git reset --hard`。
  - 整理笔记文件夹至 `~/projects/obsidian-vault/`,恢复 H5 周报项目文档(docs/ 目录 5 个需求文档)。
  - 创建学习记录文件:`.learnings/2026-04-01-git-repo-separation-and-cron-restore.md`。
  - 同步配置文件至 4 个 Agent 工作目录(更新 TOOLS.md/MEMORY.md/LEARNINGS.md):

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
65% 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 · SKILL.md (reported line 124)May include surrounding context.

md
📋 关键步骤
- **执行自我进化与经验归档**
  - 恢复 3 个定时任务(每日回顾 + AI 新闻推送),修复丢失的 `cron/jobs.json` 并添加 Git 跟踪。
  - 理清 3 个 Git 仓库关系(OpenClaw / Obsidian / H5 周报),禁止使用 `git reset --hard`。
  - 整理笔记文件夹至 `~/projects/obsidian-vault/`,恢复 H5 周报项目文档(docs/ 目录 5 个需求文档)。
  - 创建学习记录文件:`.learnings/2026-04-01-git-repo-separation-and-cron-restore.md`。
  - 同步配置文件至 4 个 Agent 工作目录(更新 TOOLS.md/MEMORY.md/LEARNINGS.md):

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The activation description uses broad trigger phrases like slow downloads, network timeout, registry setup, and domestic source configuration, which can overlap with many general support situations. Over-broad matching increases the chance this skill is invoked in inappropriate contexts, exposing users to persistent configuration changes or unrelated instructions without a clear request.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs users to permanently modify shell startup files and immediately source them, but does not clearly warn that this changes future shell behavior across sessions. Persistent profile edits can break environments, override existing settings, or silently redirect future package operations to an alternate registry if used in the wrong context.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill's documented scope is configuring a ClawHub mirror, but the embedded task record introduces unrelated operational actions such as cron restoration, repo management, workspace synchronization, and document recovery. This creates scope drift that could cause an agent or user to perform unintended filesystem and repository changes under the guise of a simple mirror-configuration task.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The entire skill document is written in Chinese and does not provide an alternative language option or state that the content is intentionally limited to a China-specific audience for compliance or regional reasons. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.