Back to skill

Security audit

Skill Updater

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent skill updater, but it can replace local agent skill files from unvalidated lockfile paths and sources, creating real review-worthy risk.

Install only if you are comfortable with a tool that can scan global skill directories and replace installed skills. Prefer running check first on an explicit --path, inspect reported sources and paths, and avoid update on lockfiles you did not create or trust until path-containment and source-validation safeguards are added.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/skill_updater.py:305
Finding

Lockfile Path Traversal Allows Out-of-Scope Directory Deletion and Replacement

Content
View full analysis
Path: path = Path(skill_path) if path.is_absolute(): return path anchor = provider_root.parent if provider_root.name.startswith(".") else provider_root return (anchor / path).resolve() ``` The resulting path is subsequently used by the update operation: ```python repo_dir = source_cache[source_url] local_skill = resolve_local_skill_path(provider, entry["skillPath"]).parent source_skill = repo_dir / Path(entry["skillPath"]).parent if local_skill.exists(): shutil.rmtree(local_skill) shutil.copytree(source_skill, local_skill) entry["skillFolderHash"] = report.latest_ref_or_hash entry["updatedAt"] = updated_at ``` ### Technical Analysis The `skillPath` value is read from `.skill-lock.json`, but the updater does not enforce that the resolved local path remains inside the expected provider or skills directory. The resolver explicitly accepts absolute paths. Relative paths are normalized with `Path.resolve()`, which processes `..` components and follows existing symbolic links, but the resolved result is not checked against an approved root such as `provider_root / "skills"`. The update function then applies destructive filesystem operations to this unvalidated path: 1. `shutil.rmtree(local_skill)` recursively deletes the resolved directory. 2. `shutil.copytree(source_skill, local_skill)` replaces it with content obtained from the selected source repository. The source-side path is also built from lockfile-controlled data without confirming that it remains inside `repo_dir`. A local hash comparison provides a partial safeguard, because an update normally proceeds only when the local tree ...[truncated 2058 chars]
Remediation
View remediation

T03 · Remote Payload Retrieval and Execution

Warning
Location
scripts/skill_updater.py:286
Finding

Unvalidated Lockfile Source URLs Enable Mutable Remote Skill Payload Installation

Content
View full analysis
Path: repo_dir = cache_root / hashlib.sha1(source_url.encode()).hexdigest() if repo_dir.exists(): run_git(repo_dir, ["fetch", "--tags", "--prune", "origin"]) return repo_dir subprocess.run( ["git", "clone", "--depth=1", source_url, str(repo_dir)], check=True, text=True, capture_output=True, ) return repo_dir ``` The URL originates from the lockfile without source-policy validation: ```python for skill_name, entry in sorted(lock.get("skills", {}).items()): source_url = entry.get("sourceUrl", "") skill_path = entry.get("skillPath") locked_hash = entry.get("skillFolderHash", "") ``` Fetched content is then installed into the local Skill directory: ```python repo_dir = source_cache[source_url] local_skill = resolve_local_skill_path(provider, entry["skillPath"]).parent source_skill = repo_dir / Path(entry["skillPath"]).parent if local_skill.exists(): shutil.rmtree(local_skill) shutil.copytree(source_skill, local_skill) entry["skillFolderHash"] = report.latest_ref_or_hash entry["updatedAt"] = updated_at ``` ### Technical Analysis The updater treats `.skill-lock.json` as authoritative for `sourceUrl`. It does not validate: - The URL scheme or transport. - The repository host. - Whether the source is an approved repository. - Whether the source identity changed after installation. - Whether the value resembles a Git command-line option. - A cryptographically authenticated commit, tag, or release. - A signature from a trusted publisher. The updater compares the installed directory with the previously re ...[truncated 2627 chars]
Remediation
View remediation
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (18)

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · scripts/skill_updater.py (reported line 587)May include surrounding context.

python
def parse_args(argv: list[str]) -> argparse.Namespace:
    parser = argparse.ArgumentParser(description="Check and update skills installed from git or lockfiles.")
    subparsers = parser.add_subparsers(dest="command", required=True)
    for command in ("check", "update"):
        sub = subparsers.add_parser(command)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README defines very broad natural-language trigger phrases such as '更新 skill', '检查 skills', and '同步 skills'. In agent platforms that dispatch skills from loosely matched user utterances, these examples can cause the updater to activate on ordinary conversation and perform repository/network inspection or even updates on local skill directories without sufficiently explicit user intent. Because this skill can scan global directories and execute update actions, ambiguous triggering increases the risk of unintended changes to local developer environments.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises operational commands that invoke shell execution and perform file reads/writes, but it does not declare any explicit tool scope such as permissions or allowed-tools. This creates an authorization ambiguity where an agent may execute filesystem or shell actions more broadly than reviewers or policy systems expect, increasing the risk of unintended modification of local skills or repositories.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger phrases are broad generic requests like '检查 skills' or '更新 skill', which can cause this skill to activate for ordinary conversations about skills rather than intentional update operations. Because the skill is capable of shell and filesystem actions, overbroad activation increases the chance of accidental execution of local scans or updates in contexts where the user did not clearly request those actions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The natural-language fields short_description and default_prompt are written only in Chinese, which can impose a specific language on users without any stated opt-in or locale justification. This matches the policy concern for language or locale constraints that are not optional or documented as region-specific.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/skill_updater.py (reported line 41)May include surrounding context.

python
def run_git(repo: Path, args: list[str], check: bool = True) -> subprocess.CompletedProcess[str]:
    return subprocess.run(
        ["git", *args],
        cwd=repo,
        check=check,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
86% confidence
Finding

The code clones and fetches arbitrary remote repositories from sourceUrl values taken from lockfiles without any allowlist, integrity verification of the remote commit, or protocol restriction. In this skill context, updating skills from untrusted or tampered sources can import attacker-controlled content into the local skills directory, enabling supply-chain compromise of agent behavior.

Content

Scanner excerpt · scripts/skill_updater.py (reported line 294)May include surrounding context.

python
if repo_dir.exists():
        run_git(repo_dir, ["fetch", "--tags", "--prune", "origin"])
        return repo_dir
    subprocess.run(
        ["git", "clone", "--depth=1", source_url, str(repo_dir)],
        check=True,
        text=True,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The updater deletes the existing local skill directory with shutil.rmtree and replaces it with remote content automatically, with no user-facing confirmation at execution time. Although a backup is created earlier, the operation still performs destructive replacement of behavior-defining files, which is especially risky because skills can change agent instructions and capabilities after a remote update.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/test_skill_updater.py (reported line 18)May include surrounding context.

python
def git(args, cwd):
    subprocess.run(["git", *args], cwd=cwd, check=True, text=True, capture_output=True)


def git_output(args, cwd):

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/test_skill_updater.py (reported line 22)May include surrounding context.

python
def git_output(args, cwd):
    return subprocess.run(["git", *args], cwd=cwd, check=True, text=True, capture_output=True).stdout.strip()


class GitSourceTests(unittest.TestCase):

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 · tests/test_skill_updater.py (reported line 144)May include surrounding context.

python
self.remote_skill_dir = self.source_repo / ".agents" / "skills" / "adapt"
        self.remote_skill_dir.mkdir(parents=True)
        (self.remote_skill_dir / "SKILL.md").write_text("# Adapt v1\n", encoding="utf-8")
        git(["add", ".agents/skills/adapt/SKILL.md"], cwd=self.source_repo)
        git(["commit", "-m", "init"], cwd=self.source_repo)

        self.local_skill_dir = self.skills_root / "adapt"

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 · tests/test_skill_updater.py (reported line 166)May include surrounding context.

python
self.remote_skill_dir = self.source_repo / ".agents" / "skills" / "adapt"
        self.remote_skill_dir.mkdir(parents=True)
        (self.remote_skill_dir / "SKILL.md").write_text("# Adapt v1\n", encoding="utf-8")
        git(["add", ".agents/skills/adapt/SKILL.md"], cwd=self.source_repo)
        git(["commit", "-m", "init"], cwd=self.source_repo)

        self.local_skill_dir = self.skills_root / "adapt"

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 · tests/test_skill_updater.py (reported line 177)May include surrounding context.

python
self.remote_skill_dir = self.source_repo / ".agents" / "skills" / "adapt"
        self.remote_skill_dir.mkdir(parents=True)
        (self.remote_skill_dir / "SKILL.md").write_text("# Adapt v1\n", encoding="utf-8")
        git(["add", ".agents/skills/adapt/SKILL.md"], cwd=self.source_repo)
        git(["commit", "-m", "init"], cwd=self.source_repo)

        self.local_skill_dir = self.skills_root / "adapt"

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 · tests/test_skill_updater.py (reported line 290)May include surrounding context.

python
self.remote_skill_dir = self.source_repo / ".agents" / "skills" / "adapt"
        self.remote_skill_dir.mkdir(parents=True)
        (self.remote_skill_dir / "SKILL.md").write_text("# Adapt v1\n", encoding="utf-8")
        git(["add", ".agents/skills/adapt/SKILL.md"], cwd=self.source_repo)
        git(["commit", "-m", "init"], cwd=self.source_repo)

        self.local_skill_dir = self.skills_root / "adapt"

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 · tests/test_skill_updater.py (reported line 301)May include surrounding context.

python
self.remote_skill_dir = self.source_repo / ".agents" / "skills" / "adapt"
        self.remote_skill_dir.mkdir(parents=True)
        (self.remote_skill_dir / "SKILL.md").write_text("# Adapt v1\n", encoding="utf-8")
        git(["add", ".agents/skills/adapt/SKILL.md"], cwd=self.source_repo)
        git(["commit", "-m", "init"], cwd=self.source_repo)

        self.local_skill_dir = self.skills_root / "adapt"

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The test parses a message using the hard-coded Chinese phrase "备份位于 ...。", which indicates the underlying skill emits a fixed Chinese user-facing message. For a code file, this is a natural-language locale policy concern when no user language choice or documented locale justification is present.

Content

No source excerpt is available for this finding.

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 · tests/test_skill_updater.py (reported line 271)May include surrounding context.

python
self.assertEqual(len(roots), len(set(roots)))

    def test_infer_provider_root_handles_openclaw_workspace(self):
        skill_path = pathlib.Path("/tmp/demo/.openclaw/workspace/skills/demo-skill/SKILL.md")

        provider_root = MODULE.infer_provider_root(skill_path)

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The file switches from English to Chinese for core descriptive and feature content, but it does not state that the skill is bilingual, ask for user language preference, or justify a fixed locale requirement. Under the language/locale policy, presenting operational instructions in a specific language without opt-in can be a policy concern.

Content

No source excerpt is available for this finding.