Back to skill

Security audit

Clawhub Manager

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its ClawHub management purpose, but a bundled test script can unintentionally publish test content to ClawHub and the package includes unsafe credential-like examples.

Install only if you are comfortable with scripts that can publish and delete ClawHub skills using your current clawhub login. Do not run scripts/test-security-scan.sh against a logged-in production account unless the publish command is mocked or changed to a dry-run/scan-only mode. Treat the built-in security scan as a convenience check, not a guarantee that a skill contains no secrets, and rotate the Tavily-like example key if it was ever real.

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/test-security-scan.sh:79
Finding

Security Test Can Perform an Unintended Real ClawHub Publication

Content
View full analysis
&1 | grep -q "安全扫描通过"; then echo "✅ 测试 1 通过:安全技能被正确识别" else echo "❌ 测试 1 失败:安全技能未被正确识别" fi ``` The invoked publication script subsequently executes: ```bash # 构建发布命令 PUBLISH_CMD=(clawhub publish "$SKILL_PATH" --version "$VERSION") [ -n "$SLUG" ] && PUBLISH_CMD+=(--slug "$SLUG") [ -n "$NAME" ] && PUBLISH_CMD+=(--name "$NAME") [ -n "$CHANGELOG" ] && PUBLISH_CMD+=(--changelog "$CHANGELOG") # 执行发布 "${PUBLISH_CMD[@]}" ``` ### Technical Analysis The test script attempts to verify the security scanner by invoking the complete `publish.sh` workflow. A successful scan does not terminate after reporting that the scan passed. Instead, `publish.sh` continues to execute the authenticated `clawhub publish` command. Piping the output through `grep -q` only checks the command's output; it does not prevent the publication command from running. Consequently, a script documented as a local scanner test can create remote content under the operator's ClawHub account. The behavior is also environment-dependent because the test uses an absolute path under `/root/.openclaw/workspace` rather than resolving `publish.sh` relative to the repository. ### Attack Path 1. An operator authenticates the `clawhub` CLI. 2. The operator runs the documented `scripts/test-security-scan.sh` test. 3. The script creates a temporary `safe-skill` directory. 4. It invokes the full `publish.sh` workflow for that directory. 5. The generated skill passes the security scan. 6. `publish.sh` executes `clawhub publish` using the operator's authenticated account. 7. Test content may be uploaded to ClawHub even though the operator intended ...[truncated 630 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/security-check.sh:246
Finding

Credential-Like Tavily API Key Is Hardcoded in a Shipped Script

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/publish.sh:94
Finding

Incomplete and Bypassable Credential Scan Can Approve Sensitive Files for Publication

Content
View full analysis
/dev/null | \ grep -vE "$placeholder_filter" || true) ``` ```bash # 通用 API Key 模式 - 更严格的检测 local generic_key_results=$(grep -rni "api[_-]?key\s*[=:]\s*['\"]?[a-zA-Z0-9/_-]{20,}" "$skill_path" \ --include="*.sh" --include="*.py" --include="*.js" 2>/dev/null | \ grep -vEi "$placeholder_filter" || true) ``` ```bash # 4. 检查敏感文件 echo "🔍 检查敏感文件..." if [ -f "$skill_path/.env" ]; then if ! grep -q "^\.env$" "$skill_path/.gitignore" 2>/dev/null; then echo "⚠️ 警告:发现 .env 文件,但未在 .gitignore 中" found_issues=1 fi fi if [ -f "$skill_path/.secrets" ]; then echo "❌ 发现敏感文件:.secrets" found_issues=1 fi if ls "$skill_path"/*.key "$skill_path"/*.pem 2>/dev/null | grep -q .; then echo "❌ 发现密钥文件(.key 或 .pem)" found_issues=1 fi ``` Equivalent weaknesses are present in `scripts/security-check.sh`. ### Technical Analysis The scanner excludes entire matching lines when they contain broad placeholder words such as `example`, `EXAMPLE`, or `xxx`. A line containing both a real secret and one of these words is discarded before credential validation. This creates a straightforward content-based bypass. Credential searches are also restricted to selected extensions such as `.md`, `.sh`, `.py`, and `.js`. Secrets stored in JSON, YAML, TOML, configuration files, archives, binaries, or extensionless files may not be inspected. The checks for `.key` and `.pem` files only use root-lev ...[truncated 1805 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (44)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · SECURITY.md (reported line 26)May include surrounding context.

md
- 其他 Secret 模式

- 🎫 **硬编码 Token**
  - Access Token
  - 其他 Token 模式

- 📁 **敏感文件**

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

md
- 其他 Secret 模式

- 🎫 **硬编码 Token**
  - Access Token
  - 其他 Token 模式

- 📁 **敏感文件**

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/publish.sh (reported line 188)May include surrounding context.

sh
- 其他 Secret 模式

- 🎫 **硬编码 Token**
  - Access Token
  - 其他 Token 模式

- 📁 **敏感文件**

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/publish.sh (reported line 189)May include surrounding context.

sh
- 其他 Secret 模式

- 🎫 **硬编码 Token**
  - Access Token
  - 其他 Token 模式

- 📁 **敏感文件**

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/publish.sh (reported line 197)May include surrounding context.

sh
- 其他 Secret 模式

- 🎫 **硬编码 Token**
  - Access Token
  - 其他 Token 模式

- 📁 **敏感文件**

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/security-check.sh (reported line 146)May include surrounding context.

sh
- 其他 Secret 模式

- 🎫 **硬编码 Token**
  - Access Token
  - 其他 Token 模式

- 📁 **敏感文件**

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/security-check.sh (reported line 147)May include surrounding context.

sh
- 其他 Secret 模式

- 🎫 **硬编码 Token**
  - Access Token
  - 其他 Token 模式

- 📁 **敏感文件**

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/test-security-scan.sh (reported line 113)May include surrounding context.

sh
- 其他 Secret 模式

- 🎫 **硬编码 Token**
  - Access Token
  - 其他 Token 模式

- 📁 **敏感文件**

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

md
- 其他 Token 模式

- 📁 **敏感文件**
  - .env 文件
  - .secrets 文件
  - *.key, *.pem 文件

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

md
- 其他 Token 模式

- 📁 **敏感文件**
  - .env 文件
  - .secrets 文件
  - *.key, *.pem 文件

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

md
- 其他 Token 模式

- 📁 **敏感文件**
  - .env 文件
  - .secrets 文件
  - *.key, *.pem 文件

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.sh (reported line 207)May include surrounding context.

sh
- 其他 Token 模式

- 📁 **敏感文件**
  - .env 文件
  - .secrets 文件
  - *.key, *.pem 文件

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/security-check.sh (reported line 171)May include surrounding context.

sh
- 其他 Token 模式

- 📁 **敏感文件**
  - .env 文件
  - .secrets 文件
  - *.key, *.pem 文件

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/security-check.sh (reported line 173)May include surrounding context.

sh
- 其他 Token 模式

- 📁 **敏感文件**
  - .env 文件
  - .secrets 文件
  - *.key, *.pem 文件

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/security-check.sh (reported line 176)May include surrounding context.

sh
- 其他 Token 模式

- 📁 **敏感文件**
  - .env 文件
  - .secrets 文件
  - *.key, *.pem 文件

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The description claims a broader 'skill management' tool covering publish, delete, query, and search. However, this code chunk only performs inspection/query of a specific skill via clawhub inspect, with optional JSON formatting and stats display. There is no evidence of publish, delete, or search behavior in the supplied code. While query is represented accurately, the declared purpose materially overstates the implemented capabilities of this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

代码的核心行为是“发布技能”,并在发布前执行较为深入的本地安全检查,这属于描述中未明确提到的附加能力。更重要的是,声明将该技能描述为涵盖发布、删除、查询和搜索的完整管理工具,但提供的代码片段仅实现发布,没有看到删除、查询、搜索相关逻辑。因此描述与实际行为在功能范围和主要用途上存在明显不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的核心能力是“技能管理”,即对 ClawHub 技能进行发布、删除、查询和搜索。但实际代码并未实现这些管理操作,也没有与 ClawHub 服务交互。相反,它执行的是本地安全检查:用 grep 扫描指定目录中的文件内容和文件类型,检测硬编码密钥、token、secret、敏感文件以及环境变量配置问题。这不是对已声明功能的辅助实现细节,而是一个独立且主要目的不同的能力,因此构成明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description says the skill is a management tool for publishing, deleting, querying, and searching ClawHub skills. The supplied code chunk does not implement those management operations directly; instead, it is a test script focused on validating security scanning in the publish workflow. While security scanning could be a supporting detail of publishing, this chunk’s primary behavior is testing and documenting that scan rather than performing the declared management functions such as delete/query/search. Therefore the code chunk’s actual purpose is materially different from the declared description, so this should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

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.sh (reported line 205)May include surrounding context.

sh
echo "🔍 检查敏感文件..."
SENSITIVE_FILES=0

if [ -f "$SKILL_PATH/.env" ]; then
  echo "  ⚠️  发现 .env 文件"
  if ! grep -q "^\.env$" "$SKILL_PATH/.gitignore" 2>/dev/null; then
    echo "    ❌ .env 未在 .gitignore 中"

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/security-check.sh (reported line 170)May include surrounding context.

sh
echo "🔍 检查敏感文件..."
SENSITIVE_FILES=0

if [ -f "$SKILL_PATH/.env" ]; then
  echo "  ⚠️  发现 .env 文件"
  if ! grep -q "^\.env$" "$SKILL_PATH/.gitignore" 2>/dev/null; then
    echo "    ❌ .env 未在 .gitignore 中"

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
87% confidence
Finding

Documenting a --skip-security option for the publish workflow creates an explicit path to bypass pre-publication secret scanning. Even though the text says it is not recommended and only for testing, users may still adopt it in routine use, allowing credentials or other sensitive content to be published without checks.

Content

Scanner excerpt · CHANGELOG.md (reported line 33)May include surrounding context.

md
### ⚙️ 改进

- **发布流程优化**:安全扫描失败时会阻止发布,并提供修复建议
- **跳过选项**:添加 `--skip-security` 参数(不推荐,仅用于测试)

### 🔧 技术细节

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
90% confidence
Finding

The example command shows exactly how to publish while disabling security scanning, which lowers the barrier to unsafe use and normalizes bypassing protections. In the context of a skill publishing tool, this increases the chance that secrets, tokens, or other unsafe content are uploaded to ClawHub without review.

Content

Scanner excerpt · CHANGELOG.md (reported line 54)May include surrounding context.

bash test-security-scan.sh

跳过安全扫描(不推荐)

bash publish.sh /path/to/skill --version 1.0.0 --skip-security

text

---

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file documents a delete operation (bash scripts/delete.sh my-skill) but provides no caution that the action removes a published skill and may be irreversible. Under the markdown-file criteria for missing user warnings, destructive operations affecting system state should be accompanied by a clear user warning.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file contains end-user guidance solely in Chinese, including headings, instructions, and warnings, with no indication that the skill is intentionally limited to Chinese-speaking users or a China-specific environment. Under the policy rules, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.generated_source_template_injection

User-controlled placeholder is embedded directly into generated source code.

Critical
Code
suspicious.generated_source_template_injection
Location
SECURITY.md:120

User-controlled placeholder is embedded directly into generated source code.

Critical
Code
suspicious.generated_source_template_injection
Location
SKILL.md:112