Back to skill

Security audit

Marila Skill Publish

Security checks for vulnerabilities and agentic risk

Overview

This is mostly a publishing guide, but it includes under-scoped instructions that could expose local tokens or unintended files during manual publishing.

Review this skill carefully before installing. Prefer the official `clawhub` CLI publishing path, avoid manual token extraction from local config files, do not upload broad file sets without a manifest, and replace blanket `git add -A` with explicit staging and secret checks. Treat any write to `~/.openclaw/workspace/skills` as an administrative action that can affect later agent behavior.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:418
Finding
Manual publishing fallback can upload sensitive local files## Vulnerability Details **File Location**: `SKILL.md:418-421` **Vulnerability Type**: Excessive sensitive-file access and unrestricted network upload **Risk Level**: High **Relevant snippet (English rendering of the source instructions):** ```text 2. Read the token from the local ClawHub configuration: - Verified macOS path: ~/Library/Application Support/clawhub/config.json 3. Manually send a multipart/form-data request to: https://clawhub.ai/api/v1/skills - Include slug, displayName, version, changelog, tags, and acceptLicenseTerms: true in the payload. - Upload each text file in the Skill directory as files. ``` ### Technical Analysis Using an authentication token and transmitting Skill files to ClawHub are consistent with the declared publishing function. However, the fallback instructs the agent to read a credential from a local configuration file and upload every text file in the Skill directory. This file-selection policy is broader than the minimum privilege required to publish a Skill. A project directory can contain `.env` files, credentials, private notes, exported data, development configuration, or other unrelated text files. The instructions do not define: - An explicit upload allowlist - Exclusion of dotfiles and credential files - A file-size limit - A secret scan - A preview of the files selected for upload - Explicit user confirmation before transmission - A mechanism that prevents the agent from observing or exposing the raw token Consequently, the legitimate publishing operation can become an unintended data-exfiltration channel even though the stated destination is the declared ClawHub service. ### Attack Path 1. A sensitive text file, such as `.env`, a private note, or a configuration export, exists in the Skill directory. 2. The normal `clawhub publish` operation encounters the documented compatibility error. 3. The agent follows the manual fallback instructio ...[truncated 919 chars]
Remediation
## Remediation Suggestions 1. Prefer the official authenticated ClawHub CLI and avoid manual token handling whenever possible. 2. If a manual API fallback remains necessary, obtain authentication through a credential helper that does not reveal the raw token to the agent or logs. 3. Replace broad text-file enumeration with an explicit allowlist, for example: - `SKILL.md` - `README.md` - `package.json` - `CHANGELOG.md` - Specifically approved files under `references/` and `scripts/` 4. Reject dotfiles, symbolic links, files outside the canonical project root, credential files, private keys, and files that exceed a documented size limit. 5. Run a secret scanner before upload and fail closed when likely credentials are detected. 6. Display the final file manifest, destination hostname, and total upload size, then require explicit user approval. 7. Ensure request diagnostics redact authorization headers, tokens, cookies, and multipart content. 8. Document the precise data transmitted and the applicable ClawHub visibility and retention behavior.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:224
Finding
Blanket Git staging can publish unrelated secrets and local data## Vulnerability Details **File Location**: `SKILL.md:102`, `SKILL.md:224`, and `SKILL.md:463` **Vulnerability Type**: Unsafe repository staging and unintended data disclosure **Risk Level**: Medium **Relevant snippet:** ```bash git add -A git commit -m "Initial commit" git push -u origin main ``` The workflow is also summarized as: ```bash git add -A && git commit && git push ``` ### Technical Analysis `git add -A` stages all tracked changes, deletions, and untracked files throughout the repository. This is broader than the minimum set of files needed for a Skill release. The documented workflow proceeds from blanket staging to commit and push without requiring review of the staged file list, inspection of the staged diff, or secret scanning. A `.gitignore` recommendation appears elsewhere, but `.gitignore` is not a sufficient control: it does not protect already tracked files, incorrectly named secrets, or files omitted from ignore rules. ### Attack Path 1. The repository contains an unrelated or sensitive file, such as `.env`, debug output, generated credentials, private test data, or an editor backup. 2. The user or agent follows the documented release procedure. 3. `git add -A` stages the sensitive file along with the intended release changes. 4. No mandatory staged-diff review or secret scan occurs. 5. The staged content is committed. 6. `git push` sends the commit to the configured GitHub remote. 7. The sensitive content remains in Git history even if it is later removed from the working tree. ### Impact Assessment The affected scope includes all repository content readable by the current user and selected by Git. Information may be exposed to everyone with access to the remote repository and, for public repositories, to the public. Leaked reusable credentials can enable access to external systems according to their permissions. Removal requires credential rotation and Git-hi ...[truncated 71 chars]
Remediation
## Remediation Suggestions 1. Replace `git add -A` with explicit staging of the intended release files. 2. Require these checks before committing: ```bash git status --short git diff --cached --name-status git diff --cached ``` 3. Run a repository secret scanner against both the working tree and staged content. 4. Abort when staged files include credential formats, unexpected dotfiles, generated data, symbolic links, or files outside the approved release manifest. 5. Require explicit user confirmation of the staged file list before commit and push. 6. Maintain a restrictive `.gitignore`, while clearly documenting that it does not replace staged-content review. 7. If a secret has already been committed, rotate it immediately and remove it from repository history using an appropriate history-rewriting procedure.

T08 · Insecure Dependencies

Note
Location
SKILL.md:43
Finding
Unpinned global installation of a third-party publishing CLI## Vulnerability Details **File Location**: `SKILL.md:22`, `SKILL.md:43`, and `SKILL.md:48` **Vulnerability Type**: Mutable global dependency installation **Risk Level**: Low **Relevant snippet:** ```bash npm install -g clawhub ``` ### Technical Analysis The installation command requests the current package version from the configured npm registry and installs it globally. It does not pin an audited version or provide an integrity constraint. Global npm installation can run package lifecycle scripts with the permissions of the invoking user and places mutable executables in a shared user or system command path. If the package, maintainer account, registry response, or local npm registry configuration is compromised, the downloaded package can execute unintended code during installation or later CLI use. No evidence indicates that the named package is malicious. The issue is the use of an unpinned, globally installed dependency without verification. ### Attack Path 1. The npm package, a maintainer account, or the configured package registry is compromised, or a future package release introduces malicious behavior. 2. A user follows the documented `npm install -g clawhub` command. 3. npm resolves the mutable latest version from the configured registry. 4. Package installation or lifecycle code executes with the user's permissions. 5. The globally installed executable remains available for later publishing commands. ### Impact Assessment Malicious installation code could access files and credentials available to the current user, alter user-level configuration, or install a modified CLI in the global command path. The exact scope depends on npm's global prefix and whether the user executes the command with elevated privileges. The documented command does not itself use `sudo`, which limits the default impact, but a compromised package could still access valuable GitHub and ClawHub credentials available to the user.
Remediation
## Remediation Suggestions 1. Pin the CLI to a reviewed version rather than installing an unconstrained latest release. 2. Link to the verified official package and publisher identity. 3. Document how to verify the package source, resolved version, and integrity before installation. 4. Prefer a project-local or otherwise isolated installation when supported. 5. Avoid elevated installation privileges. 6. Review lifecycle scripts and release provenance before updating the pinned version. 7. Add a controlled update process so dependency upgrades are reviewed instead of being silently selected at installation time.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (21)

Ae1

High
Category
analysis-evasion
Content
1. **确定版本号** — 同步修改 `SKILL.md` 和 `package.json` 的 version 字段
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
1. **确定版本号** — 同步修改 `SKILL.md` 和 `package.json` 的 version 字段
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
1. **确定版本号** — 同步修改 `SKILL.md` 和 `package.json` 的 version 字段
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
1. **确定版本号** — 同步修改 `SKILL.md` 和 `package.json` 的 version 字段
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
1. **确定版本号** — 同步修改 `SKILL.md` 和 `package.json` 的 version 字段
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
1. **确定版本号** — 同步修改 `SKILL.md` 和 `package.json` 的 version 字段
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ssd 3

High
Confidence
98% confidence
Finding
The skill advises reading a token from local ClawHub configuration and using it directly in a manual multipart API call. This semantically directs handling and reuse of sensitive credentials outside the normal authenticated CLI path, increasing the risk of token leakage, replay, logging exposure, or misuse by downstream tooling.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The skill description is written as specifically for the author's Chinese-language publishing workflow and does not indicate that other languages are supported. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation unless the regional constraint is clearly documented and justified.

Skill Enumeration

Medium
Category
Agent Snooping
Content
clawhub install marila-skill-publish

# 查看文档
cat ~/.openclaw/workspace/skills/marila-skill-publish/SKILL.md
```

## 📝 快速参考
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger description includes broad natural-language phrases such as '写完就发布' and '上线这个技能', which can match routine conversation and cause the skill to activate unexpectedly. Because this skill contains release, GitHub, and local-environment instructions, accidental invocation increases the chance of risky operational guidance being surfaced in the wrong context.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
npm install -g clawhub

# Ubuntu / Debian
sudo apt update
sudo apt install -y git gh
npm install -g clawhub
```
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
npm install -g clawhub

# Ubuntu / Debian
sudo apt update
sudo apt install -y git gh
npm install -g clawhub
```
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Session Persistence

Medium
Category
Rogue Agent
Content
1. **确定版本号** — 同步修改 `SKILL.md` 和 `package.json` 的 version 字段
2. **更新 CHANGELOG.md** — 在顶部追加新版本记录
3. **先过一遍 checklist** — 特别检查 `requires.bins` / `requires.env` / `primaryEnv` / 本地文件行为说明
4. **push + GitHub Release** — `git add -A && git commit && git push`,然后 `gh release create v0.x.x --title "v0.x.x" --notes "..."`
5. **发布到 ClawHub** — `clawhub publish <路径> --slug <名> --version x.x.x --changelog "..."`
6. **如需立即让当前 agent 使用最新技能定义,再手动同步到 agent 工作空间** — `cp <技能目录>/SKILL.md ~/.openclaw/workspace/skills/技能名/SKILL.md`
Confidence
71% confidence
Finding
This finding duplicates the same persistence concern: copying files into the agent workspace creates lasting local state and may influence future runs. In the context of a publishing skill, such stateful modification is not strictly necessary and therefore raises avoidable risk.

Session Persistence

Medium
Category
Rogue Agent
Content
1. **确定版本号** — 同步修改 `SKILL.md` 和 `package.json` 的 version 字段
2. **更新 CHANGELOG.md** — 在顶部追加新版本记录
3. **先过一遍 checklist** — 特别检查 `requires.bins` / `requires.env` / `primaryEnv` / 本地文件行为说明
4. **push + GitHub Release** — `git add -A && git commit && git push`,然后 `gh release create v0.x.x --title "v0.x.x" --notes "..."`
5. **发布到 ClawHub** — `clawhub publish <路径> --slug <名> --version x.x.x --changelog "..."`
6. **如需立即让当前 agent 使用最新技能定义,再手动同步到 agent 工作空间** — `cp <技能目录>/SKILL.md ~/.openclaw/workspace/skills/技能名/SKILL.md`
Confidence
71% confidence
Finding
This finding duplicates the same persistence concern: copying files into the agent workspace creates lasting local state and may influence future runs. In the context of a publishing skill, such stateful modification is not strictly necessary and therefore raises avoidable risk.

Context-Inappropriate Capability

Medium
Confidence
96% confidence
Finding
The document explicitly instructs readers to read a locally stored ClawHub token from the client config and use it in a handcrafted API request. That bypasses the normal CLI trust boundary, encourages direct handling of bearer credentials, and expands the skill from 'publish workflow guidance' into sensitive credential use that could expose or misuse tokens.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The natural-language description is entirely in Chinese, which imposes a language choice on users reading the skill metadata. For an all-file-types policy check, this is a locale/language constraint without any opt-in or explanation that the skill is intended only for a Chinese-speaking or region-specific audience.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The entire checklist is written in Chinese and includes no indication that language is optional, selectable, or limited to a specific regional/compliance context. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
重点新增这几类自查:

- description 不得包含机器本地目录路径(如 `~/Skills`、`~/.openclaw/workspace`)
- 不得推荐 TLS / 证书校验绕过命令(如 `NODE_TLS_REJECT_UNAUTHORIZED=0`)
- 不得把读取本地凭证文件内容作为常规排障步骤(如直接 `cat` token 文件)
- 对 agent 工作区或其他敏感目录的写操作,必须明确标注为受信任环境下的显式操作
Confidence
80% confidence
Finding
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
重点新增这几类自查:

- description 不得包含机器本地目录路径(如 `~/Skills`、`~/.openclaw/workspace`)
- 不得推荐 TLS / 证书校验绕过命令(如 `NODE_TLS_REJECT_UNAUTHORIZED=0`)
- 不得把读取本地凭证文件内容作为常规排障步骤(如直接 `cat` token 文件)
- 对 agent 工作区或其他敏感目录的写操作,必须明确标注为受信任环境下的显式操作
Confidence
80% confidence
Finding
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
文件整体以中文描述技能用途与操作流程,但未说明这是面向中文用户的限定场景,也未提供语言选择或用户偏好机制。按组织语言/地区策略,这类默认强制单一语言的说明可能构成自然语言策略违规。

Context-Inappropriate Capability

Low
Confidence
88% confidence
Finding
The instructions tell the user to copy SKILL.md into ~/.openclaw/workspace/skills, which modifies the local agent workspace outside the core publish operation. Although the document warns this is sensitive, it still normalizes filesystem writes to a privileged agent state directory and could alter future agent behavior if executed casually.

Static analysis

No suspicious patterns detected.