Back to skill

Security audit

Skill-cleaner

Security checks for vulnerabilities and agentic risk

Overview

This skill has a legitimate cleanup purpose, but it can disable or forcibly uninstall installed skills without its own validity check or confirmation gate.

Review before installing. Use report-only behavior unless you explicitly want this skill to manage installed OpenClaw skills, and do not run clean/uninstall on any name you have not verified. The implementation should add exact skill-name validation, reject valid skills during cleanup, remove forced uninstall by default, require explicit confirmation, and pin PyYAML before broad use.

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

T09 · Insecure Skill Coding Practices

Warning
Location
skill_cleaner.py:161
Finding

Cleanup Logic Can Forcibly Uninstall Healthy Skills

Content
View full analysis
str: logs = [] for skill in invalid_skills: name = skill["name"] if action == "disable": cmd = ["openclaw", "skills", "disable", name] elif action == "uninstall": cmd = ["openclaw", "skills", "uninstall", name, "--force"] else: continue output = run_cli(cmd) logs.append(f"[{name}] {output}") return "\n".join(logs) def main(): if len(sys.argv) > 1 and sys.argv[1] == "clean": if len(sys.argv) < 4: print( "用法: python skill_cleaner.py clean " ) return action = sys.argv[2] skill_list = [s.strip() for s in sys.argv[3].split(",")] diagnostics = [diagnose_skill({"name": name}) for name in skill_list] print(perform_cleanup(diagnostics, action)) return ``` ### Technical Analysis The cleanup command diagnoses each requested skill but passes every diagnostic result directly to `perform_cleanup()`. It does not verify that the resulting status is invalid before executing a destructive operation. Consequently, a skill for which `diagnose_skill()` returns `SkillStatus.VALID` is still disabled or forcibly uninstalled. The parameter name `invalid_skills` does not enforce any security property. The use of `--force` further removes opportunities for the underlying OpenClaw command to request confirmation. This contradicts the documented workflow, which states that invalid skills should be presented to the user and cleaned only after confirmation. The subprocess call uses an argument list rather than a shell command, so this is ...[truncated 1249 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
skill_cleaner.py:50
Finding

Unvalidated Skill Names Permit Path Traversal During Manifest Diagnosis

Content
View full analysis
Optional[Path]: if not WORKSPACE_SKILLS_DIR: return None target = WORKSPACE_SKILLS_DIR / skill_name if target.exists(): return target for d in WORKSPACE_SKILLS_DIR.iterdir(): if d.is_dir() and d.name.endswith(skill_name): return d return None def load_skill_manifest(skill_dir: Path) -> Optional[Dict]: manifest_path = skill_dir / "SKILL.md" if manifest_path.exists(): content = manifest_path.read_text(encoding="utf-8") if content.startswith("---"): parts = content.split("---", 2) if len(parts) >= 3: try: return yaml.safe_load(parts[1]) except yaml.YAMLError: pass ``` The attacker-controlled value enters the path through: ```python action = sys.argv[2] skill_list = [s.strip() for s in sys.argv[3].split(",")] diagnostics = [diagnose_skill({"name": name}) for name in skill_list] print(perform_cleanup(diagnostics, action)) ``` ### Technical Analysis `skill_name` is accepted from command-line input and joined directly to `WORKSPACE_SKILLS_DIR`. The code does not reject absolute paths, `..` components, path separators, or symbolic-link escapes. With `pathlib`, a relative value containing `..` can traverse above the intended workspace after filesystem resolution. An absolute `skill_name` can replace the preceding workspace path entirely. If the selected location exists, it is returned and `load_skill_manifest()` attempts to read `SKILL.md` or `skill.yaml` from that external directory. The use of `yaml.safe_load()` prevents ordinary YAML object-construction attacks, but it does not correct the path-boundary viola ...[truncated 1908 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unbounded PyYAML Dependency Produces Non-Reproducible and Uncontrolled Installations

Content
View full analysis
=6.0 ``` ### Technical Analysis The dependency specification defines only a lower bound. Package installation can therefore select any later PyYAML version available from the configured package index. This does not by itself prove that the current PyYAML package is malicious or vulnerable. However, it prevents reproducible dependency resolution and causes the reviewed package to trust future releases that were not part of the audit. A future compromised, incompatible, or vulnerable release could be installed automatically. Because `skill_cleaner.py` imports `yaml` at startup and uses it to parse skill manifests, the selected package becomes executable code in the skill's process. ### Attack Path 1. The project is installed in a new environment using `pip install -r requirements.txt`. 2. The package resolver queries the configured Python package index. 3. It selects a PyYAML release satisfying `>=6.0`, including a release published after this audit. 4. The selected package is installed without a project-provided hash or upper version constraint. 5. `skill_cleaner.py` imports the installed `yaml` package. 6. If the selected release is compromised or contains an exploitable defect, its code or defect affects the skill process. This is a supply-chain exposure scenario; the reviewed files do not contain evidence that the currently resolved PyYAML package is malicious. ### Impact Assessment Potential impact depends on the behavior of the dependency version ultimately selected. A compromised package imported by this application would execute with the same filesystem and process privileges as the user running the skill. An incompatible release could instead cause denial of service or incorrect manifest processing. There is no evidence in the reviewed proj ...[truncated 210 chars]
Remediation
View remediation
``` 2. Generate and verify dependency hashes, for example with a hash-locked requirements file: ```text PyYAML== --hash=sha256: ``` 3. Use a lock-file workflow or `pip-tools` to make transitive dependency resolution reproducible. 4. Configure installations to use a trusted package index and prevent unintended fallback to untrusted indexes. 5. Periodically review and deliberately update the pinned release after security testing rather than accepting future releases automatically. 6. Add automated dependency vulnerability scanning to the release process. ]]>
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (14)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description promises authorization checks and reliable cleanup behavior, but the analyzed behavior reportedly omits actual auth/permission validation and references an undefined status value that can cause runtime failure. In an administrative cleanup skill, this mismatch can mislead users into trusting incomplete diagnostics and can produce unsafe or incorrect cleanup decisions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README explicitly advertises automatic scanning and cleanup of invalid skills, including disabling or uninstalling them, but does not warn users about destructive side effects, scope, or rollback behavior. In a tool that operates across the workspace, undocumented deletion or disablement increases the risk of accidental loss of functionality or unintended changes by users who may assume the action is only diagnostic.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares commands that execute Python and, per the static analysis, use shell, file reads, and environment access without any explicit permission or allowed-tools scoping. For a skill that scans the workspace and can disable or uninstall other skills, missing scope boundaries increases the chance of over-broad access and unsafe execution in a sensitive administrative context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Natural-language content throughout the file, including description, triggers, and usage examples, is exclusively in Chinese with no indication that users may choose another language. This can violate a language-choice policy when the skill is not clearly documented as region-specific or opt-in.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The trigger phrases are broad enough that routine support requests about broken skills could invoke a skill capable of disabling or uninstalling components. In a destructive maintenance context, over-broad invocation increases the risk of accidental activation and unintended administrative actions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module docstring and all user-facing messages are written in Chinese, indicating the skill is designed around a fixed language/locale. There is no visible opt-in, fallback, or documented justification for restricting user interaction to Chinese, which conflicts with the policy requirement to avoid forcing a language without user choice.

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 · skill_cleaner.py (reported line 36)May include surrounding context.

python
def run_cli(cmd: List[str]) -> str:
    try:
        result = subprocess.run(cmd, capture_output=True, text=True, check=True)
        return result.stdout.strip()
    except subprocess.CalledProcessError as e:
        return e.stderr.strip()

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill goes beyond passive health inspection and can disable or forcibly uninstall other skills through external CLI commands. In an agent context, that is a destructive workspace-modification capability that can be triggered on potentially incomplete diagnostics, causing denial of service or removal of legitimate tools.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The forced uninstall path performs destructive removal without any user-facing confirmation, safety prompt, or rollback mechanism. If the diagnosis is wrong or the action is triggered accidentally, valid skills can be removed immediately, disrupting the environment and potentially deleting user-installed functionality.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The natural-language instructions and example invocation are presented only in Chinese, which can impose a language expectation without opt-in or explanation. The file does not state that the skill is region-specific or offer alternative language usage.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency is specified as pyyaml>=6.0 without an upper bound or exact pin, which makes builds non-reproducible and allows different environments to resolve to different releases. This increases supply-chain risk and makes it harder to verify whether a deployed version includes security fixes or introduces breaking or vulnerable behavior.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
pyyaml>=6.0

Unverifiable Dependency: pyyaml has 8 known advisory(ies) (CVE-2019-20477 (Deserialization of Untrusted Data in PyYAML); CVE-2020-1747 (Improper Input Validation in PyYAML); CVE-2020-14343 (Improper Input Validation in PyYAML) +5 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
90% confidence
Finding

Because the manifest does not pin a specific PyYAML version, it is not possible to determine from this file alone whether installation will select a release affected by known PyYAML advisories. In a skill that scans workspace content and may plausibly parse YAML-based skill metadata or configuration, ambiguity around a historically vulnerable parser library raises real concern, especially if unsafe YAML loading is used elsewhere.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The status enum includes MISSING_DEPENDENCY, implying the cleaner diagnoses dependency-related failures, but no code path ever checks dependencies or assigns that status. This creates an intent/documentation mismatch about what kinds of invalid skills the tool actually detects.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.