T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/wrapper.sh:41- Finding
Unattended Claude execution bypasses permission controls without sandbox enforcement
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill transparently runs unattended Claude Code sessions with permission checks disabled, which fits its purpose but gives a background agent broad host-level authority.
Install only in a disposable container, VM, or dedicated low-privilege account with only the intended project mounted. Do not use it on a host that exposes SSH keys, cloud credentials, browser profiles, production databases, unrelated repositories, or privileged local services. Expect background tmux/nohup activity, local logs that may contain sensitive output, automatic retries, and Claude Code usage under the selected account/model.
scripts/wrapper.sh:41Unattended Claude execution bypasses permission controls without sandbox enforcement
scripts/monitor.sh:159Hang recovery can launch concurrent unrestricted agents in the same workspace
scripts/wrapper.sh:89Unvalidated PID files can target unrelated processes or produce false liveness results
Referenced artifact was not completely inspected
- Session names are sanitized (`monitor.sh` rejects anything outside `[A-Za-z0-9._-]`) before being passed to tmux, preventing injection through the session-nam
Referenced artifact was not completely inspected
- Session names are sanitized (`monitor.sh` rejects anything outside `[A-Za-z0-9._-]`) before being passed to tmux, preventing injection through the session-nam
Skill contains patterns that exfiltrate system prompts or internal instructions via tool calls (file writes, network requests, logging).
# Step 1: Create secure temp directory
TMPDIR=$(mktemp -d) && chmod 700 "$TMPDIR"
# Step 2: Write prompt to file (use orchestrator's write tool, not echo/shell)
# File: $TMPDIR/prompt
# Step 3: Create initial manifest
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
_cleanup() {
tmux kill-session -t "$SESSION" 2>/dev/null || true
[ -n "${MONITOR_PID:-}" ] && kill -9 "$MONITOR_PID" 2>/dev/null || true
[ -n "${MOCK_BIN:-}" ] && rm -rf "$MOCK_BIN" 2>/dev/null || true
[ -n "${PROJECT_DIR:-}" ] && rm -rf "$PROJECT_DIR" 2>/dev/null || true
# Leave TASK_TMPDIR on failure so the user can inspect it
if [ $FAIL -eq 0 ] && [ -n "${TASK_TMPDIR:-}" ]; then
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
_cleanup() {
tmux kill-session -t "$SESSION" 2>/dev/null || true
[ -n "${MONITOR_PID:-}" ] && kill -9 "$MONITOR_PID" 2>/dev/null || true
[ -n "${MOCK_BIN:-}" ] && rm -rf "$MOCK_BIN" 2>/dev/null || true
[ -n "${PROJECT_DIR:-}" ] && rm -rf "$PROJECT_DIR" 2>/dev/null || true
# Leave TASK_TMPDIR on failure so the user can inspect it
if [ $FAIL -eq 0 ] && [ -n "${TASK_TMPDIR:-}" ]; then
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).
# Signal wrapper to use resume mode + clear stale PID
touch "$TASK_TMPDIR/resume"
rm -f "$TASK_TMPDIR/pid"
# Dispatch wrapper (resolves mode from resume file). Use printf %q to
# shell-quote WRAPPER_PATH so paths containing spaces or shell metacharacters
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).
fi
tmux pipe-pane -t "$SESSION" 2>/dev/null || true
tmux kill-session -t "$SESSION" 2>/dev/null || true
rm -f "$TASK_TMPDIR/monitor.pid" 2>/dev/null || true
_log "cleanup done"
}
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).
if [ -f "$TASK_TMPDIR/resume" ]; then
# Resume mode: monitor signaled a resume
rm -f "$TASK_TMPDIR/resume"
claude --dangerously-skip-permissions -c --model "$MODEL" &
else
# First run: launch with prompt via stdin (avoids exposing prompt in process args)
Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.
claude --dangerously-skip-permissions -c --model "$MODEL" &
else
# First run: launch with prompt via stdin (avoids exposing prompt in process args)
claude --dangerously-skip-permissions -p --model "$MODEL" - < "$TASK_TMPDIR/prompt" &
fi
# --- Lifecycle management (same for both modes) ---
The skill exposes substantial shell-execution capability through tmux, bash, and Claude Code, but does not declare an explicit tool scope such as permissions or allowed-tools in the skill metadata. That omission weakens policy enforcement and makes it easier for an orchestrator or reviewer to underestimate that this skill can execute arbitrary commands and modify project files autonomously.
The skill is explicitly designed to run Claude Code with --dangerously-skip-permissions, allowing autonomous read/write/execute actions in the project directory without interactive approval. In a fire-and-forget tmux workflow, this creates a strong pathway for unintended or malicious prompt-driven actions to execute with no human checkpoint.
**What this skill can do at runtime:**
- Execute Claude Code without any permission prompts. Claude will read, write, and run bash commands in the project directory without asking. If a coding agent with full filesystem and shell access inside your project is not acceptable, do not install this skill.
- Create and kill tmux sessions whose names match `claude-<task-name>`. If you run other tmux sessions with that prefix, the monitor's cleanup path could terminate them.
- Dispatch bash commands into tmux via `send-keys`. The orchestrator controls what gets dispatched, so a compromised or buggy orchestrator can use this skill to run arbitrary bash in the project directory.
- Write files to a secure temp directory (`mktemp -d`, `chmod 700`) and to the project directory via Claude Code.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
- Execute Claude Code without any permission prompts. Claude will read, write, and run bash commands in the project directory without asking. If a coding agent with full filesystem and shell access inside your project is not acceptable, do not install this skill.
- Create and kill tmux sessions whose names match `claude-<task-name>`. If you run other tmux sessions with that prefix, the monitor's cleanup path could terminate them.
- Dispatch bash commands into tmux via `send-keys`. The orchestrator controls what gets dispatched, so a compromised or buggy orchestrator can use this skill to run arbitrary bash in the project directory.
- Write files to a secure temp directory (`mktemp -d`, `chmod 700`) and to the project directory via Claude Code.
- Fire `openclaw system event` notifications (fire-and-forget, failures swallowed).
**What this skill does NOT do:**
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
- Execute Claude Code without any permission prompts. Claude will read, write, and run bash commands in the project directory without asking. If a coding agent with full filesystem and shell access inside your project is not acceptable, do not install this skill.
- Create and kill tmux sessions whose names match `claude-<task-name>`. If you run other tmux sessions with that prefix, the monitor's cleanup path could terminate them.
- Dispatch bash commands into tmux via `send-keys`. The orchestrator controls what gets dispatched, so a compromised or buggy orchestrator can use this skill to run arbitrary bash in the project directory.
- Write files to a secure temp directory (`mktemp -d`, `chmod 700`) and to the project directory via Claude Code.
- Fire `openclaw system event` notifications (fire-and-forget, failures swallowed).
**What this skill does NOT do:**
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
- Execute Claude Code without any permission prompts. Claude will read, write, and run bash commands in the project directory without asking. If a coding agent with full filesystem and shell access inside your project is not acceptable, do not install this skill.
- Create and kill tmux sessions whose names match `claude-<task-name>`. If you run other tmux sessions with that prefix, the monitor's cleanup path could terminate them.
- Dispatch bash commands into tmux via `send-keys`. The orchestrator controls what gets dispatched, so a compromised or buggy orchestrator can use this skill to run arbitrary bash in the project directory.
- Write files to a secure temp directory (`mktemp -d`, `chmod 700`) and to the project directory via Claude Code.
- Fire `openclaw system event` notifications (fire-and-forget, failures swallowed).
**What this skill does NOT do:**
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
TMPDIR=$(mktemp -d)
chmod 700 "$TMPDIR"
Prompt safety: Task prompts are never interpolated into shell commands. Instead, write the prompt to a temp file using the orchestrator's write tool (no shell involved). The wrapper reads the prompt via stdin redirection (claude -p --model "$MODEL" - < "$TASK_TMPDIR/prompt"), so the prompt content never appears in process arguments (invisible to ps/top) and is not subject to shell interpolation. This depends on the orchestrator's write tool not invoking a shell; OpenClaw's built-in write tool meets this requirement.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
TMPDIR=$(mktemp -d)
chmod 700 "$TMPDIR"
Prompt safety: Task prompts are never interpolated into shell commands. Instead, write the prompt to a temp file using the orchestrator's write tool (no shell involved). The wrapper reads the prompt via stdin redirection (claude -p --model "$MODEL" - < "$TASK_TMPDIR/prompt"), so the prompt content never appears in process arguments (invisible to ps/top) and is not subject to shell interpolation. This depends on the orchestrator's write tool not invoking a shell; OpenClaw's built-in write tool meets this requirement.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
TMPDIR=$(mktemp -d)
chmod 700 "$TMPDIR"
Prompt safety: Task prompts are never interpolated into shell commands. Instead, write the prompt to a temp file using the orchestrator's write tool (no shell involved). The wrapper reads the prompt via stdin redirection (claude -p --model "$MODEL" - < "$TASK_TMPDIR/prompt"), so the prompt content never appears in process arguments (invisible to ps/top) and is not subject to shell interpolation. This depends on the orchestrator's write tool not invoking a shell; OpenClaw's built-in write tool meets this requirement.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
**Prompt safety:** Task prompts are never interpolated into shell commands. Instead, write the prompt to a temp file using the orchestrator's `write` tool (no shell involved). The wrapper reads the prompt via stdin redirection (`claude -p --model "$MODEL" - < "$TASK_TMPDIR/prompt"`), so the prompt content never appears in process arguments (invisible to `ps`/`top`) and is not subject to shell interpolation. This depends on the orchestrator's `write` tool not invoking a shell; OpenClaw's built-in `write` tool meets this requirement.
**Sensitive output:** tmux scrollback and log files may contain secrets or API keys from agent output. On shared machines, restrict file permissions (`chmod 600`) and clean up temp directories after task completion.
## When to Use This
The skill intentionally launches a detached nohup monitor so it survives the parent shell and can continue managing long-running sessions. Persistence is core to the feature, but it also means code-execution and recovery logic remains active outside normal interactive oversight, increasing the blast radius if the task or monitor is misused or compromised.
Use the active monitor script for every task. The monitor runs continuously with configurable intervals and handles its own timing -- no cron or external scheduler needed.
nohup bash <skill-dir>/scripts/monitor.sh claude-<task-name> "$TMPDIR" \
>"$TMPDIR/monitor.log" 2>&1 &
Marking detached monitoring as mandatory reinforces persistent unattended execution as part of the standard workflow. In context with --dangerously-skip-permissions, this persistence increases the chance that harmful actions continue after the initiating session ends and reduces opportunities for human interruption.
6. Launch Claude Code with wrapper (PID capture + manifest updates + done-file protocol)
7. Verify pipe-pane is capturing output (`ls -la $TMPDIR/output.log`)
8. Notify user: task content, session name (`claude-<task-name>`), model used
9. Launch monitor: `nohup bash <skill-dir>/scripts/monitor.sh claude-<task-name> "$TMPDIR" >"$TMPDIR/monitor.log" 2>&1 &` (mandatory for every task; `nohup` ensures the monitor survives parent shell exit)
## Limitations
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$_SCRIPT_DIR/lib.sh"
# _log: structured log write that bypasses stdio buffering. nohup
# redirects stdout to a file, which block-buffers through libc -- so
# echo output from a still-running monitor is invisible in the log
# file until the process exits. Writing via explicit file append on
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$_SCRIPT_DIR/lib.sh"
# _log: structured log write that bypasses stdio buffering. nohup
# redirects stdout to a file, which block-buffers through libc -- so
# echo output from a still-running monitor is invisible in the log
# file until the process exits. Writing via explicit file append on
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$_SCRIPT_DIR/lib.sh"
# _log: structured log write that bypasses stdio buffering. nohup
# redirects stdout to a file, which block-buffers through libc -- so
# echo output from a still-running monitor is invisible in the log
# file until the process exits. Writing via explicit file append on
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$_SCRIPT_DIR/lib.sh"
# _log: structured log write that bypasses stdio buffering. nohup
# redirects stdout to a file, which block-buffers through libc -- so
# echo output from a still-running monitor is invisible in the log
# file until the process exits. Writing via explicit file append on
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$_SCRIPT_DIR/lib.sh"
# _log: structured log write that bypasses stdio buffering. nohup
# redirects stdout to a file, which block-buffers through libc -- so
# echo output from a still-running monitor is invisible in the log
# file until the process exits. Writing via explicit file append on