Back to skill

Security audit

Skill Priority Setup

Security checks for vulnerabilities and agentic risk

Overview

The skill is a local setup helper, but it writes persistent OpenClaw policy files and gives misleading success messages about configuration changes that are not actually implemented.

Review this skill before installing or running it. Prefer --dry-run first, inspect the generated SKILL_PRIORITY_POLICY.md manually, and do not rely on its claims that AGENTS.md, SOUL.md, or the message injector were updated unless you verify those files yourself. Avoid --auto in environments containing untrusted or oddly named skill directories.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T01 · Skill Instruction Hijacking

Warning
Location
scripts/setup.py:88
Finding
Unsanitized Skill Directory Names Permit Generated Policy Instruction Injection## Vulnerability Details **File Location**: `scripts/setup.py`, lines 88 and 264-284 **Vulnerability Type**: Markdown policy injection through an untrusted filesystem identifier **Risk Level**: Medium ### Vulnerable Code ```python skill_dir = Path(skill_file).parent skill_name = skill_dir.name self.skills_found.append({ 'name': skill_name, 'path': str(skill_dir), 'source': str(path) }) ``` The resulting untrusted skill name is subsequently embedded directly into the generated policy: ```python tier_skills = {'L0': [], 'L1': [], 'L2': [], 'L3': []} for skill, tier in self.skill_tiers.items(): tier_skills[tier].append(skill) content = f"""# Skill Priority Policy > Generated by skill-priority-setup on {datetime.now().strftime('%Y-%m-%d %H:%M')} ## Your Skill Tiers ### L0 - ROM Core (Always Active) """ for skill in sorted(tier_skills['L0']): content += f"- `{skill}`\n" content += "\n### L1 - Routing Layer (Task Triggered)\n" for skill in sorted(tier_skills['L1']): content += f"- `{skill}`\n" content += "\n### L2 - Domain Layer (Keyword Triggered)\n" for skill in sorted(tier_skills['L2']): content += f"- `{skill}`\n" content += "\n### L3 - Extension Layer (On-Demand)\n" for skill in sorted(tier_skills['L3']): content += f"- `{skill}`\n" ``` ### Technical Analysis The recursive discovery process derives each skill name directly from its parent directory name. The value is neither validated nor escaped before being inserted into `SKILL_PRIORITY_POLICY.md`. Filesystem names on supported Unix-like systems can contain newlines, backticks, Markdown syntax, and instruction-like text. An attacker-controlled skill directory can therefore terminate the intended inline-code formatting and introduce additional Markdown sections or agent instructions. Automatic mode increases exposure because `--auto` skips interactive review, although the generated policy ...[truncated 1857 chars]
Remediation
## Remediation Suggestions 1. Enforce a strict allowlist before accepting directory names as skill identifiers, for example `^[A-Za-z0-9._-]+$`. 2. Reject names containing control characters, newlines, backticks, Markdown delimiters, Unicode line separators, or other formatting characters. 3. Keep a separate validated identifier for policy serialization rather than treating a filesystem display name as trusted content. 4. Escape Markdown metacharacters before inserting any display value into the generated document. 5. Generate policy content through a structured template or serializer instead of direct string concatenation. 6. In `--auto` mode, abort when an invalid skill name is encountered and report its filesystem path rather than silently incorporating it. 7. Display the complete generated policy and require confirmation before activation when running interactively. 8. Add regression tests using names containing newlines, backticks, headings, list markers, and instruction-like text to verify that they are rejected or safely encoded.
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
There is a clear description-behavior mismatch. The declared purpose centers on operational functionality: scanning installed skills, proposing priority tiers, and auto-configuring injection policy. The actual code is a documentation generator using python-docx. It creates a README.docx containing text that describes those capabilities, but the code itself does not implement them. The only concrete behavior is document creation and file output. That is a materially different primary purpose from the declared skill behavior, so this should be flagged as a mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This is a clear description-to-code mismatch. The declared purpose claims operational functionality: scanning installed skills, suggesting priority tiers, and auto-configuring injection policy. The actual code is a documentation generator using python-docx. It builds headings, tables, and bullet lists describing the purported tool, then saves README_CN.docx to a hardcoded path. While the generated document discusses scanning, tiering, backups, and setup commands, the code itself performs none of those actions. The primary behavior is document creation, which is materially different from the declared operational skill behavior.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding
The README instructs users to run `npx clawhub` without pinning an exact package version. `npx` may fetch and execute the latest published package, which creates a supply-chain risk if a malicious or compromised version is published or if behavior changes unexpectedly over time. In a setup skill that alters agent configuration, this is more sensitive because the invoked tool can influence installation and deployment workflows.

Lp3

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding
The skill advertises behavior that implies reading and modifying local configuration and skill files, but it does not declare an explicit tool scope such as permissions or allowed-tools. That creates an authorization and review gap: users and host systems cannot clearly constrain file read/write access before execution, increasing the chance of unintended or overbroad filesystem modification.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The documentation states that the skill will apply configuration changes and update files like AGENTS.md and SOUL.md, but the warning and consent language are not prominent enough for an operation that can alter core agent behavior. Automatic modification of control/configuration files can materially change runtime policy, persistence, or future tool behavior, so insufficient disclosure increases the risk of unsafe or unexpected changes.

Vague Triggers

Medium
Confidence
77% confidence
Finding
This manifest description broadly states that the skill 'scans installed skills' and 'configures optimized token budgets' but does not define any explicit trigger phrases, activation scope, or exclusion conditions. In a manifest file, such general-purpose wording can make invocation conditions ambiguous and increase the chance of unintended activation.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The manifest says this skill scans installed skills, suggests L0-L3 tiers, and auto-configures injection policy. In this file, the only implemented behavior is constructing a static Word document and saving it to README_CN.docx; there is no scanning, analysis, recommendation, or configuration logic present.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The generated document makes concrete claims about scanning installed skills, applying configuration, creating backups, and modifying files, but this script only writes a DOCX containing those claims. In a security-sensitive skill ecosystem, misleading operational and safety claims can cause users or downstream agents to overtrust the skill, approve risky actions, or assume safeguards and backups exist when they do not.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
In auto mode, the tool skips interactive review and proceeds toward writing files and modifying configuration without an additional explicit confirmation step. For a setup utility that touches user configuration under ~/.openclaw, this increases the risk of unintended changes, especially if invoked by automation or with mistaken assumptions about detected skills.

Session Persistence

Medium
Category
Rogue Agent
Content
if self.dry_run:
            print_warning("DRY RUN MODE - No changes will be made")
        
        # Create backup
        self.create_backup()
        
        # Generate policy file
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.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The generated policy document states that ROM constraints and message injector configuration were applied even though no such updates actually occur. This creates false security assurances and can cause downstream operators or automation to trust a configuration state that does not exist.

Intent-Code Divergence

Medium
Confidence
98% confidence
Finding
The script reports that AGENTS.md and the message injector were updated, but the corresponding functions are no-ops that only print success messages. This can mislead operators into believing protective configuration changes were applied when they were not, leaving the system in an insecure or inconsistent state.

Static analysis

No suspicious patterns detected.