Back to skill

Security audit

🏗️ Skill Builder Pro

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed skill-building and publishing helper, but its command templates use user-provided names unsafely and it can publish new agent instructions, so it needs review before use.

Review generated skills before running validation or publishing, use only simple validated names and slugs, quote command arguments, confirm every shell command before execution, and treat any generated memory or usage-tracking feature as opt-in only.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:72
Finding
Command Injection Through Unvalidated Skill Names, Slugs, and Usernames<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:72`, `SKILL.md:86`, `SKILL.md:103-107`, and `SKILL.md:114`; duplicated in the Chinese section at `SKILL.md:234`, `SKILL.md:248`, `SKILL.md:265-269`, and `SKILL.md:276` **Vulnerability Type**: Shell command injection through unquoted, user-derived values **Risk Level**: High ### Vulnerable Code ```bash clawhub skill publish ./<skill-name> --dry-run ``` ```bash grep -in "AIzaSy\|sk-\|password\|secret\|@gmail\|@qq\|/home/\|192\.168" ./<skill-name>/SKILL.md ``` ```bash export PATH="$PATH:$(npm root -g)/.bin" clawhub skill publish ./<skill-name> \ --slug <slug> \ --name "<Display Name>" \ --version <new-version> ``` ```bash clawhub inspect <username>/<skill-name> ``` Equivalent vulnerable command templates are repeated at lines 234, 248, 265-269, and 276. ### Technical Analysis The workflow collects the skill name and related publication metadata from the user and later inserts those values into shell commands. The placeholders for `<skill-name>`, `<slug>`, `<username>`, and `<new-version>` are not quoted, and the document does not require strict validation before command execution. If an agent performs direct textual substitution, whitespace, shell metacharacters, command substitutions, redirections, or option-like values can change the intended command structure. Quoting `<Display Name>` alone is insufficient because the other user-derived values remain exposed. Quoting must also be paired with validation because command arguments beginning with `-` may still be interpreted as options by invoked programs. The dry-run and privacy-scan commands occur before the stated publication confirmation step. Consequently, requiring confirmation before final publication does not fully mitigate command injection in earlier workflow stages. ### Attack Path 1. An attacker supplies a crafted skill name, slug, username, or version during requirement gathering. 2. The agent generates a directory or co ...[truncated 1472 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Validate every user-controlled identifier before using it in a path or command. For skill names and slugs, enforce a restrictive rule such as: ```text ^[a-z0-9]+(?:-[a-z0-9]+)*$ ``` 2. Define similarly restrictive allowlists for usernames and versions. Semantic versions should be parsed and validated rather than passed through as arbitrary strings. 3. Reject values containing whitespace, path separators, `..`, shell metacharacters, control characters, or leading hyphens. 4. Quote all substituted shell arguments: ```bash clawhub skill publish "./${skill_name}" --dry-run grep -in \ 'AIzaSy\|sk-\|password\|secret\|@gmail\|@qq\|/home/\|192\.168' \ "./${skill_name}/SKILL.md" clawhub skill publish "./${skill_name}" \ --slug "${slug}" \ --name "${display_name}" \ --version "${version}" clawhub inspect "${username}/${skill_name}" ``` 5. Prefer invoking commands through a structured process API with an argument array instead of constructing a shell command string. Disable shell interpretation where the execution environment supports it. 6. Resolve and verify generated paths before use. Confirm that the target remains inside the intended `clawhub-skills` directory. 7. Require explicit confirmation before executing any command derived from user input, including dry-run validation and privacy scanning—not only before final publication. 8. Apply the same changes to both duplicated language sections so that neither version preserves the vulnerable templates. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Self-Modification

High
Category
Rogue Agent
Content
└── references/           # Reference docs (optional)
```

### Step 3: Write SKILL.md

Generate ClawHub-compliant SKILL.md with:
- YAML frontmatter (`name`, `description`, `version`, `metadata.openclaw`)
Confidence
85% confidence
Finding
This is a meta-skill that generates and prepares other SKILL.md files for validation and publication, which is a form of self-propagating or self-modifying agent behavior at the skill ecosystem level. In context, the danger is not arbitrary code self-rewrite of the current file, but automated generation and potential publication of new agent instructions that may include unsafe capabilities, letting insecure patterns spread quickly if user prompts or templates are malicious or insufficiently reviewed.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The instruction requires every generated skill to use 'English section first, Chinese section second,' which imposes a specific language/locale policy on all outputs. Because the file does not present this as optional or user-selected, it conflicts with the rule against forcing a language without user opt-in.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
This section says 'All skills published via this builder follow this convention' and then requires one English section and one Chinese section. That is a natural-language policy violation because it enforces a language format for all users rather than allowing language choice or limiting it to a justified regional use case.

Context-Inappropriate Capability

Medium
Confidence
89% confidence
Finding
The skill explicitly instructs generated skills needing cross-session learning to persist concepts in local memory files and to use shared memory and usage-tracking components. For a skill whose stated purpose is building, testing, and publishing skills, this broadens scope into persistent data retention and behavioral logging without clear necessity, consent, minimization, or lifecycle controls, creating avoidable privacy and data-governance risk.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The Chinese-language instructions explicitly require every skill to contain separate English and Chinese sections and require the YAML description to be in English. This is a locale restriction applied globally, with no opt-in mechanism or documented justification.

Static analysis

No suspicious patterns detected.