Back to skill

Security audit

Skill Auto Publish

Security checks for vulnerabilities and agentic risk

Overview

This publishing workflow is mostly coherent, but it gives agents authority to mutate public ClawHub registry state using user-supplied command inputs without enough command-safety constraints.

Install only if you trust the agent and environment that will run ClawHub publishing. Treat slug, path, version, and changelog values as untrusted, use fixed CLI argument arrays or equivalent safe process invocation, validate slugs and semver strictly, and confirm the source directory and review status before publishing.

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:31
Finding

Shell Command Injection Through Unvalidated Publishing Inputs

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 31–46 and 69–91
Vulnerability Type: Shell command injection through unsafe interpolation of user-controlled arguments
Risk Level: High

Vulnerable Code

markdown
2. Check required inputs: skill slug, source path, target version, changelog, expected content.
3. Confirm the source path contains SKILL.md.
4. Check for secrets or private credentials before publishing.
5. If updating an existing skill, check the current live version first.
6. Publish with the local ClawHub CLI.
7. Verify the live registry state with `clawhub inspect <slug>`.

Common commands:

```bash
clawhub publish <path> --version <semver> --changelog "<note>"
clawhub inspect <slug>
text

The copy-paste workflow also accepts the affected fields directly from a request:

```markdown
Skill slug:
[slug]

Source path:
[absolute path]

Target version:
[x.y.z]

Changelog:
[one specific release note]

Rules:
- Check that the source path contains SKILL.md.
- Check for secrets or private credentials before publishing.
- If updating an existing skill, check current live version first via clawhub inspect <slug>.
- Publish with the local ClawHub CLI.
- Verify with clawhub inspect <slug> after publishing.

Technical Analysis

The Skill accepts the slug, source path, target version, and changelog from the user and instructs the Agent to interpolate those values into command-line examples. It does not require structured process invocation, robust shell escaping, or strict validation of shell-sensitive characters.

The source path and slug are shown without quoting. Although the changelog is surrounded by double quotes, an attacker-controlled value can terminate that quoted context or use command substitution where supported. Merely checking that values are present does not establish that they are safe shell arguments.

If an implementation follows these instructions by constructing a command string and passing it to a shell, ...[truncated 1801 chars]

Remediation
View remediation

Remediation Suggestions

  1. Prohibit shell-string execution. Require invocation of a fixed executable using an argument array, such as the conceptual equivalent of:

    text
    execFile("clawhub", [
      "publish",
      validatedPath,
      "--version",
      validatedVersion,
      "--changelog",
      changelog
    ])
    

    Do not use shell=True, sh -c, bash -c, eval, or concatenated command strings.

  2. Strictly validate slugs. Apply a conservative allowlist such as:

    regex
    ^[a-z0-9]+(?:-[a-z0-9]+)*$
    

    Also enforce documented namespace restrictions and reject control characters, whitespace, path separators, and shell metacharacters.

  3. Parse versions structurally. Use a SemVer parser and reject any value that is not exactly a valid semantic version. Pass the normalized result as one process argument.

  4. Constrain source paths. Resolve the path canonically, verify that it is an existing directory containing SKILL.md, and require it to reside under an approved skill root or match an explicit canonical override. Reject null bytes, control characters, and ambiguous traversal.

  5. Treat changelogs as literal data. Permit normal prose but reject control characters and unexpected newlines where unnecessary. Always pass the entire changelog as one argument without shell interpretation.

  6. Update the Skill instructions. Explicitly state that all request fields are untrusted and must never be interpolated into a shell command. Replace copy-paste shell templates with structured tool-call examples or clearly marked placeholders accompanied by mandatory validation rules.

  7. Apply least privilege. Run publishing operations under a dedicated, non-root account with access limited to approved source directories and required ClawHub credentials.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (3)

Skill Enumeration

Medium
Category
Agent Snooping
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.

Content

Scanner excerpt · references/archive/historical-failure-notes.md (reported line 66)May include surrounding context.

md
**Root cause:** Did not check per-skill overrides. waste-audit lives in the OpenClaw workspace, not Hermes workflow-kits.

**Resolution:** Check `references/per-skill-overrides.md` before assuming a source path. waste-audit must be `/root/.openclaw/skills/waste-audit/SKILL.md`.

---

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
88% confidence
Finding

This file exposes an internal absolute filesystem path for the waste-audit skill (/root/.openclaw/skills/waste-audit/SKILL.md). While likely intended as operational documentation, it leaks environment structure and skill inventory details that could help an attacker enumerate available skills and tailor follow-on attacks against the publishing workflow or local workspace layout.

Content

Scanner excerpt · references/archive/per-skill-overrides.md (reported line 20)May include surrounding context.

md
### waste-audit

**Path:** `/root/.openclaw/skills/waste-audit/SKILL.md`

**Structure requirement:** `## Features` must be the FIRST major section. User explicitly rejected the routing-first pattern where `## Trigger / Routing Contract` appears at the top.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
89% confidence
Finding

This entry reveals another internal canonical path (/root/.openclaw/skills/buffett-do/SKILL.md) and clarifies repository layout differences between OpenClaw and Hermes. Even though this appears to be benign release documentation, it provides attackers with useful reconnaissance about filesystem layout, registry separation, and where sensitive skill sources are expected to live.

Content

Scanner excerpt · references/archive/per-skill-overrides.md (reported line 32)May include surrounding context.

md
### buffett-do

**Path:** `/root/.openclaw/skills/buffett-do/SKILL.md`

**Note:** This is NOT under Hermes workflow-kits. It is under the OpenClaw local workspace (`/root/.openclaw/skills/`).

Static analysis

No suspicious patterns detected.