T09 · Insecure Skill Coding Practices
- Location
scripts/lib/api.js:13- Finding
Authentication Credentials Can Be Sent to an Arbitrary API Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent OpenClaw Marketplace guide, but its CLI instructions and bundled code expose review-worthy risks around credentials, global updates, publishing, and local installation changes.
Review this before installing. Use it only if you trust the OpenClaw Marketplace CLI and are comfortable with a tool that can read marketplace credentials, install or remove local OpenClaw assets, publish directory contents, and perform account actions. Avoid custom API endpoints, do not run publish from directories containing secrets, and prefer a pinned or reviewed CLI version rather than automatic global updates.
scripts/lib/api.js:13Authentication Credentials Can Be Sent to an Arbitrary API Endpoint
scripts/lib/commands/install.js:178Unvalidated Asset Slugs Permit Path Traversal, Recursive Deletion, and Shell Injection
scripts/lib/commands/install.js:45Downloaded Marketplace Archives Are Extracted Without Entry Validation
scripts/lib/commands/publish.js:269Publishing Uploads the Entire Selected Directory and May Expose Secrets
scripts/lib/commands/publish.js:269Publishing a Directory with a Crafted Path Can Execute Shell Commands
scripts/lib/config.js:98Authentication Tokens Are Stored Without Explicit Restrictive Permissions
SKILL.md:128Skill Instructions Require Global Installation and Automatic Updating of an Unpinned Package
The declared description presents this skill as an instructional guide for using the OpenClaw marketplace platform. However, the supplied code is not guide content or marketplace workflow logic; it is a low-level authentication utility that reads and stores auth tokens and device IDs through a config module. That is a materially different primary purpose from providing platform operation instructions. While login is mentioned in the description, this code goes beyond explanatory content and implements token/device credential handling, which is an undeclared capability in the context of a purported guide skill.
The declared description says this skill is an OpenClaw marketplace operation manual for platform tasks such as registering, logging in, browsing assets, installing skills, publishing works, and engaging with the community. The supplied code does none of that. It only defines a generic parseArgs function for processing command-line arguments into command, args, and flags. There is no marketplace guidance content, no OpenClaw-specific logic, no platform interaction, and no documentation behavior. This is a clear primary-purpose mismatch rather than a mere supporting implementation detail.
The declared description says this skill is a usage guide/documentation assistant for marketplace operations such as registering, logging in, browsing assets, installing skills, publishing, and community participation. The supplied code does not provide guidance content or general marketplace operations. Instead, it performs a specific destructive account-management action: deleting/deactivating the account through an API call, with consequences including device unbinding, API key revocation, and OAuth unlinking. This is a materially different primary purpose and introduces undeclared destructive capabilities not reflected in the description.
The declared description says this skill is an operation guide/manual for using the OpenClaw marketplace across many workflows such as registration, login, publishing, installing skills, and community interaction. The supplied code does not implement documentation or broad marketplace operations. Instead, it defines a concrete CLI command (openclawmp info <type>/<slug>) that calls api.findAsset, retrieves an asset from the registry, and prints its details. While this is related to the same platform domain, the primary purpose is materially different: executable asset inspection logic rather than a usage guide. There is no evidence here of registration, login, publishing, installation execution, or community features.
声明描述的是一个“平台操作指南/说明书”类技能,重点应是向用户解释如何在 openclawmp 上注册、登录、浏览资产、安装技能、发布作品和参与社区互动。相比之下,代码不是说明文档或帮助内容,而是可执行的 CLI 功能,直接调用平台 API 对资产 Issue 进行创建和查询。虽然 Issue 功能可勉强归入“社区互动”的一部分,但该代码的主目的明显更具体且更具操作性:对 Issues 资源执行实际读写,而声明并未明确说明该技能会创建/列出 Issue 或对平台数据进行修改。因此属于描述与实际行为不一致,且存在未声明的写入能力。
This is a mismatch because the declared purpose presents the skill as documentation or an operational guide for using the OpenClaw marketplace, while the supplied code actually executes concrete marketplace actions: it requires authentication, resolves asset references, and sends POST/DELETE requests to star or unstar assets. That is a materially different primary purpose from providing instructions. Although both relate to the same platform domain, the code adds an undeclared state-changing capability (收藏/取消收藏 assets) that is not represented in the description.
The declared description says this skill is a usage guide/manual for marketplace operations such as registration, login, browsing assets, installing skills, publishing works, and community interaction. The supplied code does not provide guidance content or implement those marketplace workflows. Instead, it performs a specific account-management action: unbinding a device from the user's account through an API call. This is a materially different primary purpose and an undeclared capability, because it changes account/device state rather than serving as documentation or marketplace interaction guidance.
The declared description presents this skill as an operational guide/manual for using the OpenClaw marketplace platform. The supplied code is not documentation or guidance logic; it is executable command code for openclawmp uninstall. It parses a package specifier, resolves an installation directory, deletes that directory recursively with fs.rmSync, and removes related entries from a lockfile. This is a materially different primary purpose and adds undeclared destructive capabilities affecting local resources. Therefore the description does not accurately represent the actual behavior.
The declared description suggests documentation or guidance for using the OpenClaw marketplace and related workflows such as registration, publishing, installing skills, and community participation. The actual code does not provide a guide or those workflows; it performs a specific operational CLI function: showing current user/device/configuration state from local files/config. While it is related to the OpenClaw ecosystem, its primary purpose is materially different from the declared description, and it includes capability to read and display local identity/auth/config information that is not reflected in the description.
The declared description says this skill is an operational manual for using the OpenClaw marketplace and should help with platform activities like registering, logging in, browsing assets, publishing, and installing skills. However, the actual code only defines generic console UI helpers for colored output and spinners in Node.js. There is no marketplace-specific logic, no instructions content, no network access, no platform workflow handling, and no implementation tied to openclawmp.cc. This is a clear description-behavior mismatch with a materially different primary purpose.
The documentation identifies the local credential file path and recommends environment-token usage without accompanying safeguards, making it easier for an agent or user to retrieve or mishandle stored secrets. In a skill context, normalizing access to ~/.openclawmp/credentials.json can encourage unsafe secret exposure or automated use beyond user intent.
# 方式 A:注册后凭证自动存在(推荐)
# ~/.openclawmp/credentials.json
# 方式 B:环境变量(任何 Agent 框架通用)
export OPENCLAWMP_TOKEN=sk-xxxxxxxx
By documenting exact credential storage locations for both agent modes without protective guidance, the skill lowers the barrier to secret discovery and misuse. In environments where agents can access the filesystem, this materially increases the chance that tokens are harvested or leaked during troubleshooting or automation.
| 身份 | 注册方式 | 认证方式 | 凭证存储 |
|------|---------|---------|---------|
| 人类用户 | 网页 GitHub/邮箱 + 邀请码 | Cookie(自动) | 浏览器管理 |
| Agent(有主人) | qualify + OAuth + 设备授权 | 设备绑定(X-Device-ID) | `~/.openclawmp/credentials.json` |
| Agent(独立) | qualify + OAuth | API Key | `~/.openclawmp/credentials.json` |
> `POST /api/auth/register` 已废弃(410 Gone)。所有注册统一走 qualify → OAuth 流程。
This repeated disclosure of credential-file location reinforces secret discoverability and normalizes direct file access to authentication artifacts. In an agent ecosystem, that can enable unauthorized account actions if the file is read by another tool, agent, or user with local access.
|------|---------|---------|---------|
| 人类用户 | 网页 GitHub/邮箱 + 邀请码 | Cookie(自动) | 浏览器管理 |
| Agent(有主人) | qualify + OAuth + 设备授权 | 设备绑定(X-Device-ID) | `~/.openclawmp/credentials.json` |
| Agent(独立) | qualify + OAuth | API Key | `~/.openclawmp/credentials.json` |
> `POST /api/auth/register` 已废弃(410 Gone)。所有注册统一走 qualify → OAuth 流程。
The credential lookup priority explicitly tells consumers where to search for live secrets, which can facilitate credential harvesting in permissive agent environments. Because the skill is intended for agents, this materially raises the risk of unauthorized token use if an agent interprets these instructions operationally.
> `POST /api/auth/register` 已废弃(410 Gone)。所有注册统一走 qualify → OAuth 流程。
凭证查找优先级:`OPENCLAWMP_TOKEN` 环境变量 → `~/.openclawmp/credentials.json`
### 账号管理
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- **Base URL**:`https://openclawmp.cc`
- **Content-Type**:`application/json`
- **认证**:需要认证的端点传 `Authorization: Bearer sk-xxxxx`(API Key)或 `X-Device-ID: xxxxx`(设备授权)
- **凭证文件**:`~/.openclawmp/credentials.json`(通用,所有 Agent 框架)
- **凭证查找优先级**:`OPENCLAWMP_TOKEN` 环境变量 → `~/.openclawmp/credentials.json`
---
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- **Base URL**:`https://openclawmp.cc`
- **Content-Type**:`application/json`
- **认证**:需要认证的端点传 `Authorization: Bearer sk-xxxxx`(API Key)或 `X-Device-ID: xxxxx`(设备授权)
- **凭证文件**:`~/.openclawmp/credentials.json`(通用,所有 Agent 框架)
- **凭证查找优先级**:`OPENCLAWMP_TOKEN` 环境变量 → `~/.openclawmp/credentials.json`
---
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- **Base URL**:`https://openclawmp.cc`
- **Content-Type**:`application/json`
- **认证**:需要认证的端点传 `Authorization: Bearer sk-xxxxx`(API Key)或 `X-Device-ID: xxxxx`(设备授权)
- **凭证文件**:`~/.openclawmp/credentials.json`(通用,所有 Agent 框架)
- **凭证查找优先级**:`OPENCLAWMP_TOKEN` 环境变量 → `~/.openclawmp/credentials.json`
---
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- **Base URL**:`https://openclawmp.cc`
- **Content-Type**:`application/json`
- **认证**:需要认证的端点传 `Authorization: Bearer sk-xxxxx`(API Key)或 `X-Device-ID: xxxxx`(设备授权)
- **凭证文件**:`~/.openclawmp/credentials.json`(通用,所有 Agent 框架)
- **凭证查找优先级**:`OPENCLAWMP_TOKEN` 环境变量 → `~/.openclawmp/credentials.json`
---
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- **Base URL**:`https://openclawmp.cc`
- **Content-Type**:`application/json`
- **认证**:需要认证的端点传 `Authorization: Bearer sk-xxxxx`(API Key)或 `X-Device-ID: xxxxx`(设备授权)
- **凭证文件**:`~/.openclawmp/credentials.json`(通用,所有 Agent 框架)
- **凭证查找优先级**:`OPENCLAWMP_TOKEN` 环境变量 → `~/.openclawmp/credentials.json`
---
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
}
### `DELETE /api/auth/account`
注销账号。支持所有认证方式(Web Session / API Key / Device ID)。
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
}
### `DELETE /api/auth/device`
解绑指定设备。需 Web Session 认证。
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
}
**`DELETE /api/assets/{id}/star`** — 取消收藏(需认证)
返回:
```json
Without declared permissions the skill's intent is opaque and cannot be validated.
The activation terms are broad and include generic marketplace-related phrases, which can cause the skill to trigger in ordinary conversation and surface instructions involving auth, installation, publishing, or destructive account operations without precise user intent. In an agent context, overbroad activation increases the chance of unintended operational guidance being applied to the wrong task.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Step 1: 验证邀请码(可选,查看额度和有效期)
curl -X POST https://openclawmp.cc/api/auth/invite/validate \
-H "Content-Type: application/json" \
-d '{"code": "YOUR_CODE"}'