Back to skill

Security audit

ClawHub Skill Publisher

Security checks for vulnerabilities and agentic risk

Overview

This publishing helper mostly matches its stated purpose, but its token and registry handling could expose a ClawHub token in plausible misuse scenarios.

Install only if you trust the publisher and need automated ClawHub publishing. Avoid untrusted --registry values, prefer a short-lived low-scope token, review the exact skill directory or sync root before upload, and use dry runs; be aware the default CJK policy may block legitimate multilingual skills unless --allow-cjk is used.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/publish_skill.sh:109
Finding

Unrestricted registry override may redirect token authentication

Content
View full analysis
/dev/null 2>&1; then echo "Using existing ClawHub login session." return 0 fi if [[ -z "${CLAWHUB_TOKEN:-}" ]]; then load_token_from_env_file "$ENV_FILE" || { echo "Error: CLAWHUB_TOKEN not found in env or $ENV_FILE" >&2 exit 1 } fi echo "Logging into ClawHub with token (hidden)..." clawhub login --token "$CLAWHUB_TOKEN" --no-browser >/dev/null clawhub whoami >/dev/null } ``` ```bash --registry) REGISTRY="${2:-}"; shift 2 ;; ``` ```bash if [[ -n "$REGISTRY" ]]; then export CLAWHUB_REGISTRY="$REGISTRY" fi ``` The batch synchronization script implements the same behavior: ```bash --registry) REGISTRY="${2:-}"; shift 2 ;; ``` ```bash if [[ -n "$REGISTRY" ]]; then export CLAWHUB_REGISTRY="$REGISTRY" fi ensure_authenticated ``` ### Technical Analysis Both scripts accept an arbitrary value through `--registry` and export it as `CLAWHUB_REGISTRY` before authentication. No URL parsing, HTTPS requirement, hostname allowlist, port restriction, or credential-in-URL rejection is applied. The documented use cases identify `clawhub.ai` and `www.clawhub.ai` as registry endpoints, but the implementation permits any caller-supplied destination. If the installed `clawhub` CLI uses `CLAWHUB_REGISTRY` for its login request, the subsequent `clawhub login --token` operation can disclose the token to an untrusted endpoint. Successful exploitation requires control over, or influence on, the script arguments. The final network behavior also depends on how the installed CLI interprets `CLAWHUB_REGISTRY`. ### Attack Path 1. A victim has a valid `CLAWHUB_TOKEN` in the environment or in the configured env file. ...[truncated 1034 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/publish_skill.sh:109
Finding

Authentication token is exposed through process arguments

Content
View full analysis
/dev/null clawhub whoami >/dev/null ``` The same command is used by the batch synchronization script: ```bash echo "Logging into ClawHub with token (hidden)..." clawhub login --token "$CLAWHUB_TOKEN" --no-browser >/dev/null clawhub whoami >/dev/null ``` ### Technical Analysis Redirecting standard output prevents the token from being printed by this shell script, but it does not prevent disclosure through the child process argument vector. Expanding the token into `--token "$CLAWHUB_TOKEN"` places the secret in the arguments passed to the `clawhub` process. Depending on the operating system and execution environment, command arguments may be observable through process inspection, privileged monitoring agents, audit records, endpoint telemetry, debugging tools, or crash diagnostics. The exposure window may be brief, but unattended automation can execute this operation repeatedly. ### Attack Path 1. The script obtains `CLAWHUB_TOKEN` from the environment or configured env file. 2. It expands the token into the `clawhub login` command-line argument list. 3. A local process observer, administrative monitoring system, or command instrumentation captures the argument vector while login is running. 4. The observer extracts the token. 5. The exposed credential is reused according to its assigned ClawHub permissions. ### Impact Assessment The observer may obtain all ClawHub privileges assigned to the token, potentially including publishing or modifying Skills. The issue does not inherently provide operating-system privilege escalation; exploitation requires sufficient local visibility or access t ...[truncated 47 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/publish_skill.sh:126
Finding

Preflight secret checks do not cover all content sent for publication

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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (10)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
3. Skill directory contains `SKILL.md` (or `skill.md`).

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/publish_skill.sh (reported line 124)May include surrounding context.

sh
allow_cjk = (sys.argv[2].lower() == "true")

skip_dirs = {".git", "node_modules", ".cursor"}
forced_block_files = {".env", ".env.local", ".env.production", ".env.development"}

secret_patterns = [
    re.compile(r"CLAWHUB_TOKEN\s*=\s*['\"]?clh_[A-Za-z0-9_-]{12,}", re.IGNORECASE),

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/publish_skill.sh (reported line 124)May include surrounding context.

sh
allow_cjk = (sys.argv[2].lower() == "true")

skip_dirs = {".git", "node_modules", ".cursor"}
forced_block_files = {".env", ".env.local", ".env.production", ".env.development"}

secret_patterns = [
    re.compile(r"CLAWHUB_TOKEN\s*=\s*['\"]?clh_[A-Za-z0-9_-]{12,}", re.IGNORECASE),

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/publish_skill.sh (reported line 124)May include surrounding context.

sh
allow_cjk = (sys.argv[2].lower() == "true")

skip_dirs = {".git", "node_modules", ".cursor"}
forced_block_files = {".env", ".env.local", ".env.production", ".env.development"}

secret_patterns = [
    re.compile(r"CLAWHUB_TOKEN\s*=\s*['\"]?clh_[A-Za-z0-9_-]{12,}", re.IGNORECASE),

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/publish_skill.sh (reported line 124)May include surrounding context.

sh
CHANGELOG=""
TAGS="latest"
REGISTRY=""
ENV_FILE="${HOME}/.openclaw/.env"
DRY_RUN="false"

while [[ $# -gt 0 ]]; do

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/publish_skill.sh (reported line 193)May include surrounding context.

sh
CHANGELOG=""
TAGS="latest"
REGISTRY=""
ENV_FILE="${HOME}/.openclaw/.env"
DRY_RUN="false"

while [[ $# -gt 0 ]]; do

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/sync_skills.sh (reported line 70)May include surrounding context.

sh
CHANGELOG=""
TAGS="latest"
REGISTRY=""
ENV_FILE="${HOME}/.openclaw/.env"
DRY_RUN="false"

while [[ $# -gt 0 ]]; do

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README explicitly advertises a publishing block on CJK characters unless separately allowed, which is a script-based restriction rather than a narrowly tailored security control. In a publishing assistant, this can cause unjustified exclusion of legitimate multilingual content and may normalize discriminatory filtering under the guise of safety, especially because the documentation presents it as part of the standard trust-and-safety design.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill advertises operational behaviors that require reading local files and environment-backed configuration, but it does not declare any explicit tool scope or allowed-tools boundary. In an agent setting, this can lead to over-broad execution assumptions, making it easier for the skill to access unintended files or secrets during publish/sync workflows without clear user-visible authorization constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Line L72 states that the default policy blocks Chinese/CJK text from skill payloads before publishing. This is a language/locale policy constraint presented as a default behavior, but the document does not provide a clear regional or compliance justification, and it is not framed as a user choice by default.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.