Back to skill

Security audit

Kai Skill Creator

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent OpenClaw skill-building helper, but it normalizes under-scoped publishing and configuration changes that users should review carefully.

Use this skill only after reviewing the generated skill directory before installing or publishing it. Prefer a clean allowlisted template, pin the ClawHub CLI version instead of running unpinned `npx`, document real external endpoints honestly, and avoid storing long-lived secrets in plaintext config unless OpenClaw requires it and the file permissions are locked down.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Error
Location
SKILL.md:75
Finding

Unpinned Third-Party Package Execution Through npx

Content
View full analysis
--slug --version 1.0.0 --tags "tag1,tag2" ``` `scripts/create_skill.sh:123`: ```bash echo " 7. Publish: npx clawhub publish skills/$SKILL_NAME --slug $SKILL_NAME --version 1.0.0" ``` ### Technical Analysis The documented publication workflow invokes `clawhub` through `npx` without specifying a reviewed package version, integrity hash, verified installation path, or offline-only execution policy. If the package is not already available locally, `npx` may resolve and download it from the configured package registry. The downloaded package can execute JavaScript and package lifecycle logic with the permissions of the user running the command. Because dependency resolution is not pinned, the effective code can change after this Skill has been reviewed. The risk applies both to the direct instruction in `SKILL.md` and to the publication command printed by `create_skill.sh`. ### Attack Path 1. An attacker compromises the resolved `clawhub` package, publishes a malicious future version, or influences the user's configured package registry. 2. A user follows the Skill's publication instructions. 3. `npx` resolves the unpinned package and downloads the attacker-controlled version when a trusted local copy is unavailable. 4. The package executes with the invoking user's privileges. 5. The malicious package can access files, environment variables, authentication tokens, and publication credentials available to that user before optionally forwarding execution to the expected CLI behavior. ### Impact Assessment Successful exploitation permits arbitrary code execution with the privileges of the user publishing the Skill. Potentially exposed resources include: - Files readable or wr ...[truncated 376 chars]
Remediation
View remediation
``` 2. Commit the generated lockfile and verify package integrity through the package manager. 3. Invoke only the verified local installation: ```bash ./node_modules/.bin/clawhub publish skills/ \ --slug \ --version 1.0.0 \ --tags "tag1,tag2" ``` 4. If `npx` must be used, prevent network installation and require an existing local package: ```bash npx --offline --no-install clawhub publish ... ``` 5. Pin the package version explicitly, verify its provenance and integrity before execution, and use a trusted registry. 6. Run publication in an isolated environment with only the minimum credentials and filesystem access required. 7. Update both `SKILL.md` and the command printed by `scripts/create_skill.sh` so they prescribe the same hardened workflow. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/create_skill.sh:66
Finding

Generated Skills Inherit Unverified Files from a Mutable Template

Content
View full analysis
/dev/null || true fi ``` ### Technical Analysis The creator recursively copies the complete contents of a mutable local `kai-minimax-tts` Skill directory. It subsequently replaces `SKILL.md` and optionally renames one expected script, but it does not enumerate, validate, or remove other inherited content. Consequently, additional scripts, hooks, configuration files, credentials, symlinks, generated artifacts, or unrelated resources present in the template can remain in the newly generated Skill. The script does not verify template provenance, compare files against an allowlist, reject symlinks, or display the complete inherited file set for approval. The use of quoted path variables prevents direct shell command injection through the Skill name. The vulnerability instead arises from trusting and copying all content from an externally mutable template directory. ### Attack Path 1. An attacker or compromised local process obtains write access to `$HOME/.openclaw/workspace/skills/kai-minimax-tts`. 2. The attacker adds a malicious or sensitive file to that template, or modifies an inherited script other than the specifically renamed file. 3. The user runs `create_skill.sh` to create a new Skill. 4. `cp -r` silently copies the addi ...[truncated 1189 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
Findings (11)

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

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

cp -r /home/kai/.openclaw/workspace/skills/kai-minimax-tts /home/kai/.openclaw/workspace/skills/<NEW_SKILL>

text

### 2. Edit SKILL.md

**CORRECT FRONTMATTER:**
```yaml

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 92)May include surrounding context.

API_KEY="sk-api-xxxxx"

text

### ❌ NEVER Load .env in Script
```bash
# FLAGGED! Security risk
source ~/.env

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 95)May include surrounding context.

API_KEY="sk-api-xxxxx"

text

### ❌ NEVER Load .env in Script
```bash
# FLAGGED! Security risk
source ~/.env

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 107)May include surrounding context.

❌ NEVER Mention External API URLs

markdown
# FLAGGED! External endpoint reference
Get key from: https://api.example.com

Keep docs minimal. Scanner interprets URL mentions as potential data exfiltration.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill clearly instructs users to run shell commands, copy files, edit configs, and publish packages, but it declares only a binary requirement and no explicit tool scope such as shell permissions. This creates a mismatch between documented capabilities and declared permissions, which can weaken reviewability and allow a user to invoke a skill with broader operational behavior than its metadata signals.

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

md
---
name: kai-skill-creator
description: Create new OpenClaw skills that pass ClawHub validation on first attempt. Use when building a new skill for OpenClaw. Teaches the complete process from template to published skill.
metadata:
  openclaw:
    requires:

Rp1

Medium
Category
MCP Rug Pull
Confidence
87% confidence
Finding

Using npx clawhub publish without pinning a specific version can cause execution of whatever package version is resolved at runtime. That introduces supply-chain risk and non-reproducible behavior, especially for a publishing workflow that may handle credentials and modify remote state.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advises users to place API secrets directly into ~/.openclaw/openclaw.json in plaintext. Storing long-lived credentials in a general config file increases the chance of accidental disclosure through backups, logs, screenshots, file-sharing, or overly broad filesystem access.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The script instructs users to run npx clawhub publish without pinning an exact package version. npx may fetch the latest package from the registry at execution time, which creates a supply-chain risk: a malicious or compromised upstream release could execute arbitrary code on the user's machine during publish. In a skill-creation tool, this is more dangerous because it normalizes a repeated workflow that users are likely to copy verbatim.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file includes commands to copy a skill into the global skills directory and manually edit ~/.openclaw/openclaw.json, both of which change user files and system behavior. The surrounding instructions do not include a caution that these steps modify existing filesystem state or advise backing up/reviewing the target config before making changes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
71% confidence
Finding

The testing example passes en explicitly, which can imply an English-only default or expected usage pattern. Because the document does not clarify that language choice is optional or user-selected, this may conflict with policy against forcing a specific language without opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.