Back to skill

Security audit

Permission Enforcer

Security checks for vulnerabilities and agentic risk

Overview

This skill is a permission-enforcement tool, but its own enforcement can fail open and its command wrapper can run commands unsafely.

Review this carefully before installing. It is intended to enforce permissions, but missing or incomplete policy can allow actions by default, the wrapper may execute reconstructed shell commands, and command logs may contain secrets. Use only in a test environment unless these behaviors are fixed to fail closed, preserve argument boundaries, harden path checks, and redact logs.

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

T09 · Insecure Skill Coding Practices

Error
Location
check-permission.mjs:14
Finding

Policy Loading Failure Silently Disables Enhanced Permission Enforcement

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
permission-enforcer.mjs:23
Finding

Legacy Permission Evaluator Also Fails Open

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
permission-enforcer.mjs:33
Finding

Workspace Boundary Bypass Through Lexical Prefix and Symlink Paths

Content
View full analysis
resolved.startsWith(corePath)); } ``` ### Technical Analysis The functions use raw string-prefix comparisons instead of path-component-aware containment checks. A path does not have to be a descendant of `WORKSPACE_ROOT`; it only has to begin with the same characters. For example, if the workspace is: ```text /home/user/.openclaw/workspace ``` the following sibling path passes `startsWith(WORKSPACE_ROOT)`: ```text /home/user/.openclaw/workspace-escape/file.txt ``` The same defect affects OpenClaw core classification. In addition, `path.resolve()` performs lexical normalization but does not resolve symbolic links. A path that appears to be inside the workspace can therefore traverse a symlink whose target is outside it. ### Attack Path Prefix-collision variant: 1. Create or identify a sibling directory whose name begins with the complete workspace path, such as `workspace-escape`. 2. Request a write to `~/.openclaw/workspace-escape/file`. 3. `path.resolve()` preserves that sibling path. 4. `startsWith(WORKSPACE_ROOT)` returns `true`. 5. The request receives the `workspace` scope and can match an allow rule. Symlink variant: 1. Place or identify a symbolic link inside the workspace that points outside it. 2. Request a write through the symbolic-link path. 3. `path.resolve()` does not dereference the link. 4. The lexical path begins with `WORKSPACE_ROOT`. 5. The write is incorrectly classified as an in-workspace operation. ### ...[truncated 340 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
check-permission.mjs:68
Finding

Nested Nonexistent Paths Bypass Symlink Escape Protection

Content
View full analysis
/tmp/outside workspace/link/new-directory/file.txt ``` If `new-directory` does not yet exist, the immediate parent check is skipped even though the existing `link` ancestor redirects the eventual destination outside the workspace. The nested `catch` also suppresses canonicalization errors and continues toward an allow-capable scope, preserving fail-open behavior for unexpected filesystem conditions. ### Attack Path 1. Create or identify `workspace/l ...[truncated 851 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
exec-wrapper.sh:108
Finding

Argument Flattening and Shell Reinterpretation Enable Command Injection

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
exec-wrapper.sh:28
Finding

Raw Command Logging Can Expose Credentials and Other Secrets

Content
View full analysis
> "$LOG_FILE" } ``` Representative calls pass the complete command without redaction: ```bash log "Checking permission for: $original_cmd" ``` ```bash log "ALLOWED: $original_cmd" ``` ```bash log "DENIED: $original_cmd" ``` ```bash log "DRY_RUN: $original_cmd" ``` ```bash log "EXECUTING: $original_cmd" ``` ### Technical Analysis The wrapper persistently records complete command lines in `~/.openclaw/logs/exec-wrapper.log`. Command-line arguments commonly contain sensitive values, including: - API tokens and bearer headers. - Passwords supplied to command-line clients. - Signed URLs. - Database connection strings. - Private keys or secret material passed as arguments. - Confidential file paths or query data. The script creates the log directory but does not explicitly establish restrictive permissions for the log file. Its final permissions depend on the process umask and any preexisting file. No redaction, retention, or rotation controls are implemented. Denied and dry-run commands are also logged, so sensitive input can be exposed even when execution does not occur. ### Attack Path 1. A user invokes the wrapper with a credential or token in the command line. 2. The wrapper passes the complete reconstructed command to `log()`. 3. The command is appended to `~/.openclaw/logs/exec-wrapper.log` in plaintext. 4. Another local process, account, backup system, or log collector with read access obtains the log. 5. The exposed credential is reused against its associated service. ### Impact Assessment The direct impact is disclosure of secrets and operational command history. The privileges obtainable depend on the exposed credential and may range from access to a single ser ...[truncated 166 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (28)

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 16)May include surrounding context.

md
| `file_write` | `workspace` | allow | 允许写入 workspace 内文件 |
| `file_write` | `outside_workspace` | deny | 禁止写入 workspace 外 |
| `file_write` | `openclaw_core` | prompt | 修改核心文件需确认 |
| `bash` | `rm -rf /` 等 | deny | 禁止危险删除命令 |
| `bash` | `curl`, `wget` | prompt | 网络下载需确认 |
| `bash` | `sudo` | prompt | sudo 需确认 |
| `mcp` | `write_file` | prompt | MCP 文件写入需确认 |

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

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

md
| `file_write` | `openclaw_core` | prompt | 修改核心文件需确认 |
| `bash` | `rm -rf /` 等 | deny | 禁止危险删除命令 |
| `bash` | `curl`, `wget` | prompt | 网络下载需确认 |
| `bash` | `sudo` | prompt | sudo 需确认 |
| `mcp` | `write_file` | prompt | MCP 文件写入需确认 |

## 使用

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
import { checkPermission } from './permission-enforcer.mjs';

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · boundary-tests.mjs (reported line 29)May include surrounding context.

js
{
    name: "File outside workspace",
    action: "file_write",
    context: { filePath: "/etc/passwd" },
    expected: "deny"
  },
  {

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · boundary-tests.mjs (reported line 45)May include surrounding context.

js
{
    name: "File outside workspace",
    action: "file_write",
    context: { filePath: "/etc/passwd" },
    expected: "deny"
  },
  {

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · boundary-tests.mjs (reported line 47)May include surrounding context.

js
{
    name: "File outside workspace",
    action: "file_write",
    context: { filePath: "/etc/passwd" },
    expected: "deny"
  },
  {

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 · boundary-tests.mjs (reported line 69)May include surrounding context.

js
expected: "allow"
  },
  {
    name: "Bash: dangerous rm -rf /",
    action: "bash",
    context: { bashCommand: "rm -rf /" },
    expected: "deny"

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 · boundary-tests.mjs (reported line 69)May include surrounding context.

js
expected: "allow"
  },
  {
    name: "Bash: dangerous rm -rf /",
    action: "bash",
    context: { bashCommand: "rm -rf /" },
    expected: "deny"

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 · boundary-tests.mjs (reported line 71)May include surrounding context.

js
{
    name: "Bash: dangerous rm -rf /",
    action: "bash",
    context: { bashCommand: "rm -rf /" },
    expected: "deny"
  },
  {

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script is presented as a permission-enforcing wrapper, but if the policy checker file is missing it offers the user an option to continue with no policy enforcement at all. That fail-open behavior defeats the core security boundary and allows dangerous commands to run unvalidated, especially if the checker is removed, misplaced, or tampered with.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% 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 16)May include surrounding context.

md
EXAMPLES:
  exec-wrapper.sh ls -la
  exec-wrapper.sh rm -rf /tmp/test
  exec-wrapper.sh curl https://example.com

FEATURES:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% 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 · boundary-tests.mjs (reported line 69)May include surrounding context.

js
EXAMPLES:
  exec-wrapper.sh ls -la
  exec-wrapper.sh rm -rf /tmp/test
  exec-wrapper.sh curl https://example.com

FEATURES:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% 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 · boundary-tests.mjs (reported line 71)May include surrounding context.

js
EXAMPLES:
  exec-wrapper.sh ls -la
  exec-wrapper.sh rm -rf /tmp/test
  exec-wrapper.sh curl https://example.com

FEATURES:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% 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 · exec-wrapper.sh (reported line 176)May include surrounding context.

sh
EXAMPLES:
  exec-wrapper.sh ls -la
  exec-wrapper.sh rm -rf /tmp/test
  exec-wrapper.sh curl https://example.com

FEATURES:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% 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 · exec-wrapper.sh (reported line 182)May include surrounding context.

sh
EXAMPLES:
  exec-wrapper.sh ls -la
  exec-wrapper.sh rm -rf /tmp/test
  exec-wrapper.sh curl https://example.com

FEATURES:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% 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 · exec-wrapper.sh (reported line 176)May include surrounding context.

sh
EXAMPLES:
  exec-wrapper.sh ls -la
  exec-wrapper.sh rm -rf /tmp/test
  exec-wrapper.sh curl https://example.com

FEATURES:

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 · exec-wrapper.sh (reported line 182)May include surrounding context.

sh
FEATURES:
  • Intercepts commands before execution
  • Checks against enforcer-policy.json
  • Blocks dangerous commands (rm -rf /, sudo, etc.)
  • Prompts for risky operations
  • Supports dry-run mode
  • Logs all decisions

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% 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 · exec-wrapper.sh (reported line 182)May include surrounding context.

sh
FEATURES:
  • Intercepts commands before execution
  • Checks against enforcer-policy.json
  • Blocks dangerous commands (rm -rf /, sudo, etc.)
  • Prompts for risky operations
  • Supports dry-run mode
  • Logs all decisions

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The permission checker is implemented with a fail-open default: if no rule matches, it returns { allowed: true }. In a security enforcement component, this means missing, malformed, or incomplete policy coverage silently permits sensitive actions such as shell execution or file writes, which can completely bypass intended restrictions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The primary descriptive text is written entirely in Chinese, which imposes a language choice on users without any opt-in, fallback, or note that the skill is region-specific. This matches the language/locale policy violation category because no user choice or documented justification is provided.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
| `file_write` | `openclaw_core` | prompt | 修改核心文件需确认 |
| `bash` | `rm -rf /` 等 | deny | 禁止危险删除命令 |
| `bash` | `curl`, `wget` | prompt | 网络下载需确认 |
| `bash` | `sudo` | prompt | sudo 需确认 |
| `mcp` | `write_file` | prompt | MCP 文件写入需确认 |

## 使用

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · boundary-tests.mjs (reported line 75)May include surrounding context.

js
| `file_write` | `openclaw_core` | prompt | 修改核心文件需确认 |
| `bash` | `rm -rf /` 等 | deny | 禁止危险删除命令 |
| `bash` | `curl`, `wget` | prompt | 网络下载需确认 |
| `bash` | `sudo` | prompt | sudo 需确认 |
| `mcp` | `write_file` | prompt | MCP 文件写入需确认 |

## 使用

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · boundary-tests.mjs (reported line 77)May include surrounding context.

js
| `file_write` | `openclaw_core` | prompt | 修改核心文件需确认 |
| `bash` | `rm -rf /` 等 | deny | 禁止危险删除命令 |
| `bash` | `curl`, `wget` | prompt | 网络下载需确认 |
| `bash` | `sudo` | prompt | sudo 需确认 |
| `mcp` | `write_file` | prompt | MCP 文件写入需确认 |

## 使用

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The cleanup uses recursive forced deletion against a path derived from the user's home workspace without interactive confirmation or additional safety validation. If the directory variable is miscomputed, altered, or points somewhere unexpected, this can cause unintended data loss.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script advertises boundary protection, but its authorization model is fail-open: if no policy rule matches, evaluate() returns allow. In a permission-enforcement component, this means missing, malformed, incomplete, or bypassed policy coverage can silently grant access, undermining the claimed protection and enabling unauthorized actions.

Content

No source excerpt is available for this finding.