Back to skill

Security audit

Permission Manager

Security checks for vulnerabilities and agentic risk

Overview

The skill is openly about managing approvals, but it can persistently turn off command approvals from broad prompts without enforced confirmation, so it needs review before installation.

Install only if you intentionally want a skill that can change OpenClaw command-approval policy. Treat no-approval mode as dangerous: it disables approval prompts and persists in user configuration. Before using this skill, require a two-step confirmation for any move to full or no-approval mode, consider removing broad trigger phrases, and verify ~/.openclaw/openclaw.json after changes.

Vulnerability Patterns
  • 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
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
permission_switch.py:69
Finding

No-approval mode can be enabled without enforced human confirmation

Content
View full analysis

Vulnerability Details

File Location: permission_switch.py:69-117, 332-333; related consent requirement in SKILL.md:79-83
Vulnerability Type: Approval-control bypass and privilege escalation
Risk Level: High

Vulnerable Code

The no_approval mode defines a policy that grants unrestricted command execution without approval:

python
"no_approval": {
    "name": "免审批模式",
    "security": "full",
    "ask": "off",
    "safety": "⭐",
    "convenience": "⭐⭐⭐⭐⭐",
    "description": "所有命令自动执行,无需任何审批",
    "recommendation": "仅用于可信环境,存在安全风险"
},

The mode is applied directly to the persistent OpenClaw configuration:

python
def switch_mode(self, mode_name: str) -> Dict[str, Any]:
    """
    切换权限模式(直接修改配置文件)

    Args:
        mode_name: 模式名称(default/full/no_approval/strict)

    Returns:
        切换结果
    """
    if mode_name not in self.MODES:
        # 尝试模糊匹配
        matched_mode = self._fuzzy_match_mode(mode_name)
        if matched_mode:
            mode_name = matched_mode
        else:
            return {
                "success": False,
                "error": f"未知模式:{mode_name}",
                "available_modes": list(self.MODES.keys()),
                "mode_names": {k: v["name"] for k, v in self.MODES.items()}
            }

    mode = self.MODES[mode_name]

    # 直接修改配置文件
    try:
        if not os.path.exists(self.config_path):
            return {
                "success": False,
                "error": f"配置文件不存在:{self.config_path}"
            }

        # 读取配置
        with open(self.config_path, 'r', encoding='utf-8') as f:
            config = json.load(f)

        # 修改 tools.exec 配置
        if "tools" not in config:
            config["tools"] = {}
        if "exec" not in config["tools"]:
            config["tools"]["exec"] = {}

        config["tools"]["exec"]["security"] = mode["security"]
        config
...[truncated 3278 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require an explicit confirmation mechanism specifically for no_approval. In interactive use, display the old and proposed policies and require an exact confirmation phrase before writing the configuration.
  2. Reject non-interactive activation by default. If automation is necessary, require a separate, narrowly scoped authorization token or protected flag rather than treating the mode name as sufficient authorization.
  3. Bind confirmation to the requested configuration, user, and a short expiration period so an old confirmation cannot be replayed.
  4. Prefer temporary elevation with automatic rollback after a defined timeout. Restore the previous policy even if the process or Gateway exits unexpectedly.
  5. Record an audit event containing the initiating identity, timestamp, previous policy, new policy, and confirmation method.
  6. Perform configuration writes atomically using a temporary file and rename operation. Preserve a secure backup and verify that the destination is not an attacker-controlled symbolic link.
  7. Validate the resulting configuration after writing and fail closed by restoring the prior approval policy if validation fails.
  8. Treat security = full or ask = off as security-sensitive downgrades and enforce authorization in the executable itself rather than relying on agent instructions or documentation.
Vulnerability Patterns
  • 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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (15)

Vague Triggers

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Phrases like '免审批模式' and especially '关闭所有审批' are both ambiguous and map to the most dangerous configuration, full plus ask off. A casual or quoted phrase could disable all approval gates, enabling arbitrary command execution without further human review.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill says disabling approvals requires explicit human consent, but the no-approval example shows immediate execution after a simple request. This creates an unsafe precedent that can normalize bypassing the consent checkpoint, increasing the chance that an agent disables approvals without a clear, informed confirmation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README presents '免审批模式' as a supported convenience option without a strong, front-loaded warning that it disables approval checks and substantially lowers system safety. For a permission-management skill, weak warning language increases the chance that users enable a dangerous mode without understanding that commands may execute without human review.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documented trigger phrases for mode switching are broad natural-language commands such as '完整权限', '免审批模式', and '关闭所有审批', which can plausibly appear in normal conversation, summaries, or quoted text. Because this skill controls approval and execution safeguards, unintended invocation could silently weaken protections or disable approval checks, making the consequence materially security-relevant rather than just a usability issue.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill documents shell execution and configuration/file modification behavior but does not declare an explicit tool scope such as permissions or allowed-tools. That mismatch weakens policy enforcement and reviewability, making it easier for a high-impact skill to run with broader capabilities than users or platform controls expect.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill description, instructions, triggers, warnings, and examples are all presented in Chinese, which effectively forces a specific language for interaction. There is no indication that the user can opt into another language or that the locale restriction is intentionally documented as region-specific.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Trigger phrases such as '完整权限' or '开发模式' are broad and may appear in ordinary discussion, which can cause unintended elevation to full-permission mode. When a skill changes execution security settings, ambiguous intent recognition materially increases the risk of accidental privilege escalation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The keyword-matching rules are overly simplistic for a security-sensitive action and map short phrases directly to powerful configuration changes. This makes the skill susceptible to accidental triggers, prompt injection via quoted text, or misclassification of conversational context, resulting in inappropriate permission changes.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The description advertises rapid switching between highly sensitive approval modes, including full permissions and no-approval operation, without any stated trigger constraints, authorization checks, or safety boundaries. In a permission-management skill, broad activation language is more dangerous than usual because it could encourage invocation in contexts where a user did not clearly intend to disable approval safeguards.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file's natural-language strings and documentation are entirely in Chinese, and there is no indication that the user can choose another language or locale. Under the stated policy, a skill that effectively enforces one language without opt-in is a natural-language policy violation unless the constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill directly rewrites the user's OpenClaw execution policy file and supports switching to weaker settings such as full or no_approval, which can silently disable or reduce approval gates for future command execution. In an agent-skill context, changing trust/approval controls is security-sensitive state modification and is dangerous without an explicit, informed confirmation step at execution time.

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

python
def _run_command(self, cmd: list) -> Dict[str, Any]:
        """运行命令"""
        try:
            result = subprocess.run(
                cmd,
                capture_output=True,
                text=True,

Vague Triggers

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The examples “当前权限设置”, “查看审批模式”, and “现在是什么权限” are generic questions that could arise in normal conversation and are not clearly limited to this skill. The documentation does not provide exclusion conditions or a strict trigger syntax to distinguish invocation from casual reference.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The description is entirely in Chinese and provides no indication that the skill supports other user languages or is intentionally restricted to a Chinese-speaking context. This can violate language/locale policy if the skill is selected for users without an explicit language opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest description says the skill is for quickly switching between 白名单/完整权限/免审批, which presents a three-mode scope. The code defines and exposes a fourth mode, 'strict', with different semantics ('ask' = 'always'), so the implemented behavior exceeds the stated description rather than matching it exactly.

Content

No source excerpt is available for this finding.