T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- run-claude.sh:26
- Finding
- <![CDATA[Claude Code Executes with Permission Checks Disabled]]><![CDATA[ ## Vulnerability Details **File Location**: `run-claude.sh:26-31` **Vulnerability Type**: Execution with unrestricted tool permissions **Risk Level**: High ### Vulnerable Code ```bash OUTPUT=$(env -u CLAUDECODE claude \ --permission-mode bypassPermissions \ --print \ $CONTINUE \ "$PROMPT" 2>&1) ``` The same unsafe execution mode is explicitly prescribed in `SKILL.md:54-57`: ```bash OUTPUT=$(cd /workdir && env -u CLAUDECODE claude --permission-mode bypassPermissions --print "task" 2>&1) OUTPUT=$(cd /workdir && env -u CLAUDECODE claude --permission-mode bypassPermissions --print --continue "task" 2>&1) ``` ### Technical Analysis The `--permission-mode bypassPermissions` option disables Claude Code's normal approval boundary for tool use. As a result, the delegated agent can execute shell commands and perform filesystem operations without requesting confirmation. The prompt is accepted from the Skill invocation, and the working directory can be selected by the caller. No sandbox, filesystem allowlist, command allowlist, or network restriction is applied by the wrapper. Consequently, Claude Code receives all permissions available to the operating-system account running OpenClaw, rather than only the permissions required for a particular project task. This does not independently grant root privileges, but it breaks least-privilege boundaries within the host user's accessible environment. ### Attack Path 1. An attacker supplies malicious or misleading content through a chat message or another prompt source consumed by the Skill. 2. OpenClaw delegates that content to `run-claude.sh` as `PROMPT`. 3. The wrapper starts Claude Code with `--permission-mode bypassPermissions`. 4. Claude Code processes the content and can invoke filesystem, shell, and other enabled tools without an approval prompt. 5. Commands run with the privileges of the OpenClaw host account and can access any resource available to that account. ### Impact Assessment Succe ...[truncated 627 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `--permission-mode bypassPermissions` and use Claude Code's normal permission and approval workflow. 2. If unattended execution is required, configure a narrowly scoped tool allowlist instead of globally bypassing permissions. 3. Run delegated tasks inside a sandbox or container with: - A project-scoped filesystem mount. - No access to home-directory credentials. - Restricted or disabled network access. - A dedicated low-privilege operating-system account. 4. Canonicalize and validate the requested working directory against an explicit allowlist. 5. Require confirmation for destructive operations, access outside the active project, and execution of package managers or network tools. 6. Treat delegated prompts as untrusted input and clearly delimit user-provided content from trusted task instructions. 7. Update `SKILL.md` and `README.md` so they no longer recommend bypassing permission enforcement. ]]>
