Back to skill

Security audit

Skill Guard — Pre-Install Security Scanner

Security checks for vulnerabilities and agentic risk

Overview

This is a real security-scanning helper, but its installer can delete unintended files and runs unpinned remote code, so it needs review before installing.

Treat this as a Review item before installation. Do not run it as-is on important workspaces or with elevated privileges. At minimum, validate skill slugs against a strict allowlist, canonicalize and contain every delete or move path, remove or strongly gate --skip-scan, pin mcp-scan to a reviewed version, and avoid curl-to-shell dependency setup.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
Findings (3)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:96
Finding

Unverified Remote Installer Is Piped Directly Into a Shell

Content
View full analysis
Remediation
View remediation
/install.sh" echo " uv-installer.sh" | sha256sum -c - sh uv-installer.sh ``` ]]>

T08 · Insecure Dependencies

Error
Location
scripts/safe-install.sh:126
Finding

Security Scanner Executes an Unpinned Latest Dependency

Content
View full analysis
&1) || scan_exit_code=$? ``` Related unpinned dependency guidance appears in `SKILL.md:95-96`: ```bash - `clawhub` CLI — `npm i -g clawhub` - `uv` — `curl -LsSf https://astral.sh/uv/install.sh | sh` ``` ### Technical Analysis Every scan resolves and executes `mcp-scan@latest`. The `latest` tag is mutable, so the package code that runs can differ from the version originally reviewed with this Skill. This undermines the security boundary because the component intended to inspect untrusted Skills is itself retrieved through an unpinned supply chain. `uvx` executes the package locally. A compromised publisher account, package registry, dependency, or newly malicious release could therefore run attacker-controlled code before the target Skill is approved. The scanner also receives the staged Skill path and can access other files available to the invoking user. The globally installed `clawhub` CLI is likewise not pinned in the documentation, further reducing reproducibility, although the directly executable `mcp-scan@latest` invocation is the principal issue. ### Attack Path 1. An attacker compromises the `mcp-scan` package, one of its dependencies, or the corresponding package-publishing account. 2. A compromised release is assigned the `latest` version. 3. The user invokes `safe-install.sh`. 4. `uvx mcp-scan@latest` resolves and executes the compromised package. 5. Malicious package initialization or runtime code executes with the user's privileges, independently of whether the staged Skill passes scanning. ### Impact Assessment A malicious dependency executes with the invoking user's permissions. It can potentially read user-accessible files and staged Skill contents, access av ...[truncated 226 chars]
Remediation
View remediation
" scan_output=$(uvx "mcp-scan==$MCP_SCAN_VERSION" --skills "$staged_path" 2>&1) || scan_exit_code=$? ``` The exact syntax should follow the package registry used by `uvx`, and the selected version should be accompanied by integrity verification. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/safe-install.sh:97
Finding

Unvalidated Skill Slug Enables Path-Traversal Deletion

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (24)

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · SKILL.md (reported line 3)May include surrounding context.

md
---
name: skill-guard
description: Scan ClawHub skills for security vulnerabilities BEFORE installing. Use when installing new skills from ClawHub to detect prompt injections, malware payloads, hardcoded secrets, and other threats. Wraps clawhub install with mcp-scan pre-flight checks.
---

# skill-guard

**The only pre-install security gate for ClawHub skills.**

## Why skill-guard?

| | **VirusTotal** (ClawHub built-in) | **skillscanner** (Gen Digital) | **skill-guard** |
|---|---|---|---|
| **When it runs** | After publish (server-side) | On-demand lookup | **Before install (client-side)** |
| **What it checks**

Instruction Override

High
Category
Prompt Injection
Confidence
80% confidence
Finding

This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 22)May include surrounding context.

md
| **AI-specific threats** | ❌ | ❌ | ✅ |
| **Install blocking** | ❌ | ❌ | ✅ |

**VirusTotal** catches known malware binaries — but won't flag `<!-- IGNORE PREVIOUS INSTRUCTIONS -->`.

**skillscanner** checks if Gen Digital has reviewed it — but can't scan new or updated skills.

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 22)May include surrounding context.

md
| **AI-specific threats** | ❌ | ❌ | ✅ |
| **Install blocking** | ❌ | ❌ | ✅ |

**VirusTotal** catches known malware binaries — but won't flag `<!-- IGNORE PREVIOUS INSTRUCTIONS -->`.

**skillscanner** checks if Gen Digital has reviewed it — but can't scan new or updated skills.

YARA rule 'agent_skill_prompt_injection_hidden_instructions': Prompt injection or hidden instructions embedded in AI agent skill text [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · SKILL.md (reported line 22)May include surrounding context.

md
t-side)** |
| **What it checks** | Malware signatures | Their database | **Actual skill content** |
| **Prompt injections** | ❌ | ❌ | ✅ |
| **Data exfiltration URLs** | ❌ | ❌ | ✅ |
| **Hidden instructions** | ❌ | ❌ | ✅ |
| **AI-specific threats** | ❌ | ❌ | ✅ |
| **Install blocking** | ❌ | ❌ | ✅ |

**VirusTotal** catches known malware binaries — but won't flag `<!-- IGNORE PREVIOUS INSTRUCTIONS -->`.

**skillscanner** checks if Gen Digital has reviewed it — but can't scan new or updated skills.

**skill-guard** uses [mcp-scan](https://github.com/invariantlabs-ai/mcp-scan) (Invariant Labs, acquired by Snyk) to analyze what's actually in the skill, catches AI-specific threats, and blocks install if issues are found.

## The Problem

Skills can contain:
- 🎭 **Prompt injections** — hidden "ignore previous instructions" attacks
- 💀 **Malware payloads** — dangerous commands disguised in natural language  
- 🔑 **Hardcoded secrets** — API keys, t

Instruction Override

High
Category
Prompt Injection
Confidence
80% confidence
Finding

This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

md
## The Problem

Skills can contain:
- 🎭 **Prompt injections** — hidden "ignore previous instructions" attacks
- 💀 **Malware payloads** — dangerous commands disguised in natural language  
- 🔑 **Hardcoded secrets** — API keys, tokens in plain text
- 📤 **Data exfiltration** — URLs that leak your conversations, memory, files

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 43)May include surrounding context.

md
./scripts/safe-install.sh some-skill

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 69)May include surrounding context.

md
./scripts/safe-install.sh some-skill

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 72)May include surrounding context.

md
./scripts/safe-install.sh some-skill

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 75)May include surrounding context.

md
./scripts/safe-install.sh some-skill

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

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).

Content

Scanner excerpt · SKILL.md (reported line 91)May include surrounding context.

md
Skill stays in `/tmp/skill-guard-staging/skills/<slug>/` (quarantined). You can:
1. **Review** — read the scan output, inspect the files
2. **Install anyway** — `mv /tmp/skill-guard-staging/skills/<slug> ~/.openclaw/workspace/skills/`
3. **Discard** — `rm -rf /tmp/skill-guard-staging/`

## Requirements

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

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).

Content

Scanner excerpt · SKILL.md (reported line 91)May include surrounding context.

md
Skill stays in `/tmp/skill-guard-staging/skills/<slug>/` (quarantined). You can:
1. **Review** — read the scan output, inspect the files
2. **Install anyway** — `mv /tmp/skill-guard-staging/skills/<slug> ~/.openclaw/workspace/skills/`
3. **Discard** — `rm -rf /tmp/skill-guard-staging/`

## Requirements

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

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).

Content

Scanner excerpt · SKILL.md (reported line 91)May include surrounding context.

md
Skill stays in `/tmp/skill-guard-staging/skills/<slug>/` (quarantined). You can:
1. **Review** — read the scan output, inspect the files
2. **Install anyway** — `mv /tmp/skill-guard-staging/skills/<slug> ~/.openclaw/workspace/skills/`
3. **Discard** — `rm -rf /tmp/skill-guard-staging/`

## Requirements

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The script deletes a path derived in part from user-controlled SKILL_SLUG using rm -rf. Although quoted, there is no validation that the slug is a simple safe name; path traversal or unexpected path components could cause deletion outside the intended staging subtree if a malicious slug is accepted.

Content

Scanner excerpt · scripts/safe-install.sh (reported line 96)May include surrounding context.

sh
stage_skill() {
    print_info "Fetching $SKILL_SLUG to staging area..."
    
    rm -rf "$STAGING_DIR/skills/$SKILL_SLUG"
    mkdir -p "$STAGING_DIR"
    
    # Install to staging directory (clawhub creates skills/<slug> under workdir)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

With --force, the script recursively deletes $SKILLS_DIR/$SKILL_SLUG, where the final path is influenced by user input and an environment-controlled base directory. If either value is manipulated, the command could remove arbitrary directories, making this a potentially destructive path traversal issue.

Content

Scanner excerpt · scripts/safe-install.sh (reported line 151)May include surrounding context.

sh
if [[ -d "$SKILLS_DIR/$SKILL_SLUG" ]]; then
        if [[ -n "$FORCE_ARG" ]]; then
            rm -rf "$SKILLS_DIR/$SKILL_SLUG"
        else
            print_error "Skill already exists at $SKILLS_DIR/$SKILL_SLUG (use --force to overwrite)"
            exit 1

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Cleanup uses rm -rf on a path incorporating the skill slug without canonical path safety checks. A crafted slug could cause cleanup to target unintended filesystem locations, especially because this function may run automatically after installation attempts.

Content

Scanner excerpt · scripts/safe-install.sh (reported line 165)May include surrounding context.

sh
# Cleanup staging
cleanup() {
    rm -rf "$STAGING_DIR/skills/$SKILL_SLUG" 2>/dev/null || true
}

# Main flow

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

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).

Content

Scanner excerpt · scripts/safe-install.sh (reported line 205)May include surrounding context.

sh
echo "Options:"
        echo "  1. Review the issues above and decide if they're acceptable"
        echo "  2. Run: mv $STAGING_DIR/skills/$SKILL_SLUG $SKILLS_DIR/ to install anyway"
        echo "  3. Run: rm -rf $STAGING_DIR/skills/$SKILL_SLUG to discard"
        echo ""
        exit 2  # Exit code 2 = issues found, not installed
    fi

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
76% confidence
Finding

The skill documentation describes shell-based installation and cleanup flows, but the manifest does not declare any explicit tool scope such as permissions or allowed-tools. In an agent ecosystem, missing tool constraints can cause the skill to be granted broader shell capability than intended, increasing the blast radius if the skill or a dependent script is compromised.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The header comment states the skill scans before installing, but actual behavior allows scanning to be skipped. This mismatch is security-relevant because operators may rely on the documented guarantee and unknowingly deploy unscanned content.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script markets itself as a secure pre-install scanner, yet exposes a first-class --skip-scan option that installs unreviewed skills. This weakens the trust model around the tool and makes accidental or socially engineered bypass of the security gate much more likely.

Content

No source excerpt is available for this finding.

Session Persistence

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

Content

Scanner excerpt · scripts/safe-install.sh (reported line 48)May include surrounding context.

sh
echo ""
            echo "Options:"
            echo "  --version <ver>  Install specific version"
            echo "  --force          Overwrite existing installation"
            echo "  --skip-scan      Skip security scan (not recommended)"
            echo "  --help           Show this help"
            echo ""

Rp1

Medium
Category
MCP Rug Pull
Confidence
65% confidence
Finding

uvx/uv tool run commands without ==version create a rug-pull risk.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The script executes uvx mcp-scan@latest, which intentionally pulls the latest scanner version at runtime rather than a pinned, reviewed version. This creates a supply-chain and reproducibility risk: a compromised or breaking upstream release could alter scan behavior, miss detections, or execute unexpected code during what is supposed to be a security control.

Content

No source excerpt is available for this finding.

External Script Fetching

Low
Category
Supply Chain
Confidence
91% confidence
Finding

The documentation recommends piping a remote install script directly into the shell. This creates a supply-chain risk because network-delivered code executes immediately without integrity verification, allowing compromise if the source, transport, or DNS path is tampered with.

Content

Scanner excerpt · SKILL.md (reported line 96)May include surrounding context.

md
## Requirements

- `clawhub` CLI — `npm i -g clawhub`
- `uv` — `curl -LsSf https://astral.sh/uv/install.sh | sh`

## Why This Matters

External Script Fetching

Low
Category
Supply Chain
Confidence
89% confidence
Finding

The script recommends installing a dependency with curl ... | sh, a classic unsafe pattern that executes remote content directly in a shell without local verification. Even though it is only printed as guidance, users may copy-paste it, making the tool an amplifier for supply-chain compromise if the remote installer or network path is abused.

Content

Scanner excerpt · scripts/safe-install.sh (reported line 86)May include surrounding context.

sh
source "$HOME/.local/bin/env"
        fi
        if ! command -v uvx &> /dev/null; then
            print_error "uvx not found. Install uv with: curl -LsSf https://astral.sh/uv/install.sh | sh"
            exit 1
        fi
    fi

Static analysis

Detected: suspicious.prompt_injection_instructions

Prompt-injection style instruction pattern detected.

Warn
Code
suspicious.prompt_injection_instructions
Location
SKILL.md:22