Back to skill

Security audit

openclaw-skill-generator

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent OpenClaw skill generator, but it asks agents to make broad local changes and auto-install tools without enough user approval or containment.

Install only if you are comfortable with a skill that can create, replace, backup, and repair local OpenClaw skill folders. Do not allow unattended package installs or sudo/admin commands; review generated files before deployment, confirm exact target paths, and avoid running it in directories where untrusted users can create symlinks or modify .openclaw contents.

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

Warning
Location
SKILL.md:35
Finding
Automatic Installation of Unverified Third-Party Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:35-42`; `references/tool-setup-guide.md:16-18, 90-105, 145-170` **Vulnerability Type**: Unsafe dependency discovery and automatic installation **Risk Level**: Medium ### Vulnerable Code Snippets `SKILL.md:35-42`: ```markdown 4. 遇到工具缺失、运行时未安装、权限不足、编译器缺失或环境未配置时,必须读取 `references/tool-setup-guide.md` 并按其中流程处理 5. 能自动安装或自动配置时优先自动完成;确实无法自动完成时,再切换手动模式并让用户在本地终端或文件管理器执行 ``` This instructs the Agent to prioritize automatic installation or configuration whenever possible. `references/tool-setup-guide.md:16-18`: ```markdown - 先确认工具是否真实可用,不要凭空假设 - 能自动安装就自动安装,能自动配置就自动配置 - 不能自动完成时,再切换手动模式 ``` `references/tool-setup-guide.md:99-105`: ```markdown | macOS | Homebrew | `brew install node` | | macOS (无 Homebrew) | 官网安装包 | 访问 https://nodejs.org → 下载 LTS | | Ubuntu / Debian | apt | `sudo apt update && sudo apt install nodejs npm` | | CentOS / RHEL | yum | `sudo yum install nodejs npm` | | Windows | 官网安装包 | 访问 https://nodejs.org → 下载 LTS → 双击安装 | | Windows (有 winget) | winget | `winget install OpenJS.NodeJS.LTS` | | 任意平台 | nvm(版本管理器) | https://github.com/nvm-sh/nvm | ``` `references/tool-setup-guide.md:151-170`: ```markdown - `https://<tool-name>.dev/docs/installation` - `https://<tool-name>.io/getting-started` - `https://docs.<tool-name>.com` | `npm` | Node.js 工具 | `npm search <tool-name>` | | `pip` | Python 工具 | `pip search <tool-name>` 或查 https://pypi.org | `https://github.com/<org>/<tool-name>` 直接搜索 `<tool-name> installation guide <platform>` 获取最新安装方式。 ``` ### Technical Analysis The Skill's execution protocol authorizes the Agent to discover and automatically install missing tools. Discovery may be performed through package-manager searches, guessed documentation domains, GitHub repositories, or general web search. The protocol does not require: - Explicit user approval before installation - An allowlist of acceptable packages or publishers - Verification that a package is maintained by the legitima ...[truncated 2158 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require explicit, informed user approval before installing any package, runtime, compiler, or system tool. 2. Maintain an allowlist of approved package names, publishers, registries, and official download domains. 3. Reject package names supplied solely through untrusted generated requirements unless their identity is independently verified. 4. Pin exact package versions and verify cryptographic hashes or signatures where supported. 5. Inspect package metadata, publisher history, repository ownership, transitive dependencies, and lifecycle scripts before installation. 6. For npm, use lockfiles and consider `--ignore-scripts` during initial inspection. 7. Install generated-Skill dependencies in an isolated, least-privilege environment rather than globally. 8. Prohibit unattended `sudo`, administrator, or system-wide installation. 9. Replace guessed documentation URLs and unrestricted web searches with verified official project records. 10. Record the dependency name, source, version, integrity value, requested privileges, and proposed commands in the approval prompt. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/write_file.js:36
Finding
Filesystem Boundary Checks Can Be Bypassed Through Symbolic Links and Lookalike Paths<![CDATA[ ## Vulnerability Details **File Location**: `scripts/write_file.js:36-50`; `scripts/write_skill.js:47-50, 89-93, 137-158` **Vulnerability Type**: Improper pathname validation and symlink traversal **Risk Level**: Medium ### Vulnerable Code Snippets `scripts/write_file.js:36-50`: ```javascript const filePath = path.resolve(args.file); // 安全边界校验:必须写入到 .openclaw 目录下 if (!filePath.replace(/\\/g, '/').includes('/.openclaw/')) { console.error(JSON.stringify({ status: "error", code: "PATH_TRAVERSAL_BLOCKED", message: `拒绝访问:目标路径不在 .openclaw 边界内 (${filePath})`, file: __filename })); process.exit(1); } const dirPath = path.dirname(filePath); try { fs.mkdirSync(dirPath, { recursive: true }); if (args.content !== undefined) { // Content provided via argument fs.writeFileSync(filePath, args.content, "utf8"); ``` `scripts/write_skill.js:47-50`: ```javascript const destPath = path.resolve(args.dest); if (!destPath.replace(/\\/g, '/').includes('/.openclaw/')) { return { code: "PATH_TRAVERSAL_BLOCKED", message: `拒绝访问:目标路径不在 .openclaw 边界内 (${destPath})` }; } ``` `scripts/write_skill.js:89-93`: ```javascript function removeDirIfExists(target) { if (fs.existsSync(target)) { fs.rmSync(target, { recursive: true, force: true }); } } ``` `scripts/write_skill.js:137-158`: ```javascript try { fs.mkdirSync(destParent, { recursive: true }); removeDirIfExists(stageDir); removeDirIfExists(rollbackDir); copyDir(source, stageDir); if (destExists) { fs.renameSync(dest, rollbackDir); renamedOldDest = true; } fs.renameSync(stageDir, dest); if (renamedOldDest) { removeDirIfExists(rollbackDir); } // 部署成功后清理源草稿目录 (Garbage Collection) if (source !== dest && fs.existsSync(source)) { removeDirIfExists(source); } ``` ### Technical Analysis Both writing utilities treat the presence of the string `/.openclaw/` in an absolute lexical path as proof that the destination is within the legitimate OpenClaw directo ...[truncated 2884 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pass the trusted `skillsPath` explicitly to every write and deployment utility. 2. Canonicalize the approved root with `fs.realpathSync()` before performing containment checks. 3. Resolve the nearest existing parent of a prospective destination with `realpathSync()` and reconstruct only validated non-existing path components. 4. Verify containment using `path.relative()` rather than substring matching. Reject paths when the relative result is absolute, equals `..`, or begins with `..` plus a separator. 5. Inspect every existing path component with `fs.lstatSync()` and reject symbolic links, junctions, and Windows reparse points. 6. For existing destination files, use no-follow semantics where the platform and Node.js API permit them. 7. Write new content to a securely created temporary file in the validated destination directory and atomically rename it into place after repeating containment checks. 8. Validate `source`, `dest`, staging, rollback, and cleanup paths independently. 9. Ensure the source draft is specifically under `<skillsPath>/.drafts` and the destination is a direct child of `<skillsPath>`. 10. Use restrictive permissions and prevent untrusted users from modifying the OpenClaw Skills directory during generation or deployment. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (43)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The workflow goes beyond 'brand-new' creation by deploying directories, replacing existing destinations, and deleting source drafts after success, none of which are clearly disclosed in the description. Destructive and replacement operations materially raise risk of data loss or unauthorized modification if triggered incorrectly.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The workflow goes beyond 'brand-new' creation by deploying directories, replacing existing destinations, and deleting source drafts after success, none of which are clearly disclosed in the description. Destructive and replacement operations materially raise risk of data loss or unauthorized modification if triggered incorrectly.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The workflow goes beyond 'brand-new' creation by deploying directories, replacing existing destinations, and deleting source drafts after success, none of which are clearly disclosed in the description. Destructive and replacement operations materially raise risk of data loss or unauthorized modification if triggered incorrectly.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The workflow goes beyond 'brand-new' creation by deploying directories, replacing existing destinations, and deleting source drafts after success, none of which are clearly disclosed in the description. Destructive and replacement operations materially raise risk of data loss or unauthorized modification if triggered incorrectly.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The workflow goes beyond 'brand-new' creation by deploying directories, replacing existing destinations, and deleting source drafts after success, none of which are clearly disclosed in the description. Destructive and replacement operations materially raise risk of data loss or unauthorized modification if triggered incorrectly.

Ae1

High
Category
analysis-evasion
Content
- 文件夹内必须包含 `SKILL.md`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- 文件夹内必须包含 `SKILL.md`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- 文件夹内必须包含 `SKILL.md`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- 文件夹内必须包含 `SKILL.md`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- 文件夹内必须包含 `SKILL.md`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- 文件夹内必须包含 `SKILL.md`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- 文件夹内必须包含 `SKILL.md`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- 文件夹内必须包含 `SKILL.md`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node ./scripts/write_skill.js --source "<draftPath>" --dest "<targetPath>" --if-exists error
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node ./scripts/write_skill.js --source "<draftPath>" --dest "<targetPath>" --if-exists error
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node ./scripts/backup_skill.js --skill-path "<targetPath>"
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Chaining Abuse

High
Category
Tool Misuse
Content
|------|---------|------|
| macOS | Homebrew | `brew install node` |
| macOS (无 Homebrew) | 官网安装包 | 访问 https://nodejs.org → 下载 LTS |
| Ubuntu / Debian | apt | `sudo apt update && sudo apt install nodejs npm` |
| CentOS / RHEL | yum | `sudo yum install nodejs npm` |
| Windows | 官网安装包 | 访问 https://nodejs.org → 下载 LTS → 双击安装 |
| Windows (有 winget) | winget | `winget install OpenJS.NodeJS.LTS` |
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Chaining Abuse

High
Category
Tool Misuse
Content
|------|---------|------|
| macOS | Homebrew | `brew install node` |
| macOS (无 Homebrew) | 官网安装包 | 访问 https://nodejs.org → 下载 LTS |
| Ubuntu / Debian | apt | `sudo apt update && sudo apt install nodejs npm` |
| CentOS / RHEL | yum | `sudo yum install nodejs npm` |
| Windows | 官网安装包 | 访问 https://nodejs.org → 下载 LTS → 双击安装 |
| Windows (有 winget) | winget | `winget install OpenJS.NodeJS.LTS` |
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The README documents that the skill can write files, replace installed skills, and perform backup/rollback operations, but it does not prominently warn users that running the workflow will modify local OpenClaw skill directories. In a tool that automates filesystem changes, missing user-facing warnings and confirmation expectations can lead to accidental overwrite or replacement of existing skills, especially because deployment is described as a normal phase of operation.

Session Persistence

Medium
Category
Rogue Agent
Content
### What is this?

An OpenClaw skill that acts as an interactive wizard for creating a brand-new OpenClaw skill folder (required `SKILL.md` + optional helper scripts). It should trigger only when a human explicitly asks to create a new skill in the conversation.

### Install
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.

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill instructs file writes, path discovery, deployment, backup, and command execution but does not declare a restrictive tool scope such as allowed-tools or permissions. That creates unnecessary ambient authority, making it easier for the skill to access environment capabilities beyond what is needed and increasing the blast radius if the workflow is mis-triggered or prompt-injected.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The skill directs automatic installation or configuration of tools when dependencies are missing, which exceeds the expected scope of simply generating a skill folder. Automatically changing the host environment can introduce supply-chain, persistence, or system-integrity risk, especially if package sources and permissions are not tightly controlled.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The instructions prefer automatic installation/configuration when possible but do not require a clear user-facing warning that the system will be modified. Silent or under-disclosed host changes are risky because users may not realize the skill is about to install software or alter environment state.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
The backup and overwrite workflow modifies existing skill directories and supports replacement behavior, which is riskier than simple creation and can alter functioning skills. In the context of a generator skill, these instructions increase the chance of destructive changes to deployed content.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The documented purpose is to create a new skill, but later phases instruct post-install testing, repair, backup, and iterative modification of an installed skill. This scope creep makes the skill more dangerous because it becomes an editor/maintainer of existing deployed content rather than a one-time generator.

Static analysis

No suspicious patterns detected.