Back to skill

Security audit

Uninstaller

Security checks for vulnerabilities and agentic risk

Overview

This is a real OpenClaw uninstaller, but its host-level scripts can delete data and contain unsafe path and argument handling that users should review before use.

Review this skill before installing or running it. Use it only when you intend to completely remove OpenClaw from the specific gateway host, avoid running it as an administrator, verify `OPENCLAW_STATE_DIR` is exactly the OpenClaw state directory, and prefer a verified local OpenClaw CLI over the unpinned npx fallback. Do not pass untrusted email or ntfy values to the scheduler.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/schedule-uninstall.sh:43
Finding

Host Command Injection Through Notification Arguments

Content
View full analysis
/dev/null; then ``` The same unsafe command string is passed to the Linux execution paths: ```bash if systemd-run --user --onetime --unit=openclaw-uninstall \ /bin/bash -c "$CMD" &>/dev/null; then echo "Linux uninstall scheduled (systemd), will run in ~${DELAY}s." else # Fallback: nohup + disown (works when systemd-run unavailable, e.g. WSL2 without systemd) (nohup bash -c "$CMD" >> "$LOG_FILE" 2>&1 &) ``` ### Technical Analysis Values supplied through `--notify-email` and `--notify-ntfy` are appended to a command string between single quotes. The script does not escape embedded single quotes before passing the result to `bash -c`. Shell metacharacters placed after an embedded quote are consequently interpreted as command syntax rather than as part of a notification argument. Array usage while initially collecting the arguments does not protect the values because the array is later converted back into an unsafe shell command string. The Skill documentation explicitly requires this scheduler to run on the gateway host rather than in a sandbox. Exploitation therefore results in command execution directly on that host with the privileges of the user running the Agent. ### Attack Path 1. An attacker persuades the user or Agent to request an ntfy topic or email value containing shell syntax, such as: ```text x'; touch /tmp/openclaw-injected; #' ``` 2. The Agent invokes: ```bash ./scripts/schedule-uninstall.sh --notify-ntfy "x'; to ...[truncated 795 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/uninstall-oneshot.sh:48
Finding

Environment-Controlled Recursive Deletion Without Path Validation

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/schedule-uninstall.sh:9
Finding

Predictable Shared Temporary Log File Permits Symlink Attacks

Content
View full analysis
/dev/null; then ``` ```xml StandardOutPath$LOG_FILE StandardErrorPath$LOG_FILE ``` ```bash (nohup bash -c "$CMD" >> "$LOG_FILE" 2>&1 &) ``` The uninstall script also appends through `tee`: ```bash LOG_FILE="/tmp/openclaw-uninstall.log" ... log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" | tee -a "$LOG_FILE"; } ``` ### Technical Analysis `/tmp` is normally writable by all local users. The fixed filename can be created in advance by another local account. The scripts do not verify file ownership, reject symbolic links, create the file exclusively, or place it in a private directory. Shell append redirection and `tee -a` normally follow symbolic links. A local attacker can therefore pre-create the log path as a symbolic link to another file writable by the victim. When the victim schedules or runs the uninstall, log output is appended to the symlink target. Platform-specific temporary-directory protections may reduce exploitability in some environments, but the code itself does not provide the required safety guarantees. ### Attack Path 1. A local attacker predicts the constant filename. 2. Before the victim executes the Skill, the attacker creates: ```bash ln -s /path/to/victim-writable-file /tmp/openclaw-uninstall.log ``` 3. The victim runs the scheduler or uninstall script. 4. Output redirection or `tee -a` follows the symbolic link. 5. Uninstall log content is appended to the selected target file. ### Impact As ...[truncated 421 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:86
Finding

Unpinned Package Download and Execution in Documented Uninstall Procedure

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (48)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description presents the skill primarily as a guidance resource, but the body instructs the agent to autonomously schedule and perform destructive uninstall actions and optionally send outbound notifications. This mismatch can bypass user and reviewer expectations, making high-impact host actions more likely to be invoked under the guise of simple advice.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}" deletes a path derived from an environment variable, which could be manipulated to point outside the intended application directory. In a host-executed uninstall flow, that makes accidental or malicious deletion of arbitrary user data possible.

Content

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

md
1. Stop gateway: `openclaw gateway stop`
2. Uninstall service: `openclaw gateway uninstall`
3. Delete state: `rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"`
4. Uninstall CLI: `npm rm -g openclaw` (or pnpm/bun)
5. macOS app: `rm -rf /Applications/OpenClaw.app`

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 · SKILL.md (reported line 94)May include surrounding context.

md
1. Stop gateway: `openclaw gateway stop`
2. Uninstall service: `openclaw gateway uninstall`
3. Delete state: `rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"`
4. Uninstall CLI: `npm rm -g openclaw` (or pnpm/bun)
5. macOS app: `rm -rf /Applications/OpenClaw.app`

### CLI already removed (manual service cleanup)

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

md
2. Uninstall service: `openclaw gateway uninstall`
3. Delete state: `rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"`
4. Uninstall CLI: `npm rm -g openclaw` (or pnpm/bun)
5. macOS app: `rm -rf /Applications/OpenClaw.app`

### CLI already removed (manual service cleanup)

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 · SKILL.md (reported line 102)May include surrounding context.

md
case "$(uname -s)" in
  Darwin)
    launchctl bootout "gui/$UID/ai.openclaw.gateway" 2>/dev/null || true
    rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist
    for f in ~/Library/LaunchAgents/com.openclaw.*.plist; do
      [[ -f "$f" ]] && rm -f "$f"
    done

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 · scripts/uninstall-oneshot.sh (reported line 35)May include surrounding context.

sh
case "$(uname -s)" in
  Darwin)
    launchctl bootout "gui/$UID/ai.openclaw.gateway" 2>/dev/null || true
    rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist
    for f in ~/Library/LaunchAgents/com.openclaw.*.plist; do
      [[ -f "$f" ]] && rm -f "$f"
    done

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 · scripts/uninstall-oneshot.sh (reported line 37)May include surrounding context.

sh
launchctl bootout "gui/$UID/ai.openclaw.gateway" 2>/dev/null || true
    rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist
    for f in ~/Library/LaunchAgents/com.openclaw.*.plist; do
      [[ -f "$f" ]] && rm -f "$f"
    done
    ;;
  Linux)

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 · SKILL.md (reported line 108)May include surrounding context.

md
;;
  Linux)
    systemctl --user disable --now openclaw-gateway.service 2>/dev/null || true
    rm -f ~/.config/systemd/user/openclaw-gateway.service
    systemctl --user daemon-reload 2>/dev/null || true
    ;;
esac

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 · scripts/uninstall-oneshot.sh (reported line 42)May include surrounding context.

sh
;;
  Linux)
    systemctl --user disable --now openclaw-gateway.service 2>/dev/null || true
    rm -f ~/.config/systemd/user/openclaw-gateway.service
    systemctl --user daemon-reload 2>/dev/null || true
    ;;
esac

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

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

md
;;
esac

# 3. Delete state dir
STATE_DIR="${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"
if [[ -d "$STATE_DIR" ]]; then
  log "Removing state dir: $STATE_DIR"

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · scripts/uninstall-oneshot.sh (reported line 47)May include surrounding context.

sh
;;
esac

# 3. Delete state dir
STATE_DIR="${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"
if [[ -d "$STATE_DIR" ]]; then
  log "Removing state dir: $STATE_DIR"

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

md
# 6. macOS app
if [[ "$(uname -s)" == "Darwin" ]] && [[ -d "/Applications/OpenClaw.app" ]]; then
  log "Removing macOS app"
  rm -rf /Applications/OpenClaw.app
fi

log "=== Uninstall complete ==="

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 · scripts/uninstall-oneshot.sh (reported line 75)May include surrounding context.

sh
# 6. macOS app
if [[ "$(uname -s)" == "Darwin" ]] && [[ -d "/Applications/OpenClaw.app" ]]; then
  log "Removing macOS app"
  rm -rf /Applications/OpenClaw.app
fi

log "=== Uninstall complete ==="

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 · scripts/uninstall-oneshot.sh (reported line 75)May include surrounding context.

sh
# 6. macOS app
if [[ "$(uname -s)" == "Darwin" ]] && [[ -d "/Applications/OpenClaw.app" ]]; then
  log "Removing macOS app"
  rm -rf /Applications/OpenClaw.app
fi

log "=== Uninstall complete ==="

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The skill clearly instructs the agent to execute shell scripts and destructive uninstall commands, but the manifest does not declare any explicit tool scope or permission boundaries. That increases the risk of accidental or overbroad execution because reviewers and policy systems cannot easily constrain what tools the skill is expected to use.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The trigger description is broad enough that ordinary cleanup or support conversations could unintentionally activate a destructive uninstall workflow. In a skill capable of host-level execution, ambiguous invocation criteria materially increase the chance of accidental system changes.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The example trigger phrase includes very generic wording like 'Uninstall', which may match unrelated conversations or other software contexts. Because the documented flow leads to autonomous uninstall scheduling, an overly broad trigger creates real accidental-execution risk.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

Using npx -y openclaw without a pinned version fetches and executes whatever package version is current at runtime. That creates a supply-chain risk where a malicious or compromised package update could run arbitrary code during uninstall on the host machine.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

The script is explicitly designed to create a launchd/systemd one-shot that persists beyond the current agent session. In a security context, persistence mechanisms are sensitive because they allow actions to occur later without an active user session, which can be abused if an attacker can trigger the scheduler or substitute the uninstall payload.

Content

Scanner excerpt · scripts/schedule-uninstall.sh (reported line 2)May include surrounding context.

sh
#!/usr/bin/env bash
# schedule-uninstall.sh — Create launchd/systemd one-shot to run uninstall after delay.
# Agent calls this; script returns immediately after scheduling.
# Usage: schedule-uninstall.sh [--notify-email EMAIL] [--notify-ntfy TOPIC]
# Requires: host=gateway (must run on host, not in sandbox)

Session Persistence

Medium
Category
Rogue Agent
Confidence
86% confidence
Finding

Using launchctl submit creates a deferred job managed by the OS, allowing the uninstall to execute after the initiating context has ended. While not inherently malicious in an uninstall utility, this is still a persistence primitive that can be dangerous if invoked unexpectedly or by another component without strong confirmation and provenance checks.

Content

Scanner excerpt · scripts/schedule-uninstall.sh (reported line 50)May include surrounding context.

sh
case "$(uname -s)" in
  Darwin)
    if launchctl submit -l openclaw-uninstall -o "$LOG_FILE" -e "$LOG_FILE" -- \
      /bin/bash -c "$CMD" 2>/dev/null; then
      echo "macOS uninstall scheduled (launchctl), will run in ~${DELAY}s."
    else

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This script schedules execution of an uninstall script after a delay and then returns immediately, which creates a destructive action decoupled from the initiating session. Although the skill’s stated purpose is legitimate removal, the scheduled one-shot provides only a generic success message and no explicit last-chance confirmation at the moment the destructive operation is queued, increasing the risk of accidental or coerced removal.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

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.

Content

Scanner excerpt · scripts/schedule-uninstall.sh (reported line 67)May include surrounding context.

sh
$EXEC_LINE
WRAPEOF
      chmod +x "$WRAPPER"
      PLIST_DIR="${TMPDIR:-/tmp}"
      PLIST="$PLIST_DIR/openclaw-uninstall-$$.plist"
      cat > "$PLIST" << PLISTEOF
<?xml version="1.0"?>

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

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.

Content

Scanner excerpt · scripts/schedule-uninstall.sh (reported line 68)May include surrounding context.

sh
$EXEC_LINE
WRAPEOF
      chmod +x "$WRAPPER"
      PLIST_DIR="${TMPDIR:-/tmp}"
      PLIST="$PLIST_DIR/openclaw-uninstall-$$.plist"
      cat > "$PLIST" << PLISTEOF
<?xml version="1.0"?>

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

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.

Content

Scanner excerpt · scripts/schedule-uninstall.sh (reported line 69)May include surrounding context.

sh
$EXEC_LINE
WRAPEOF
      chmod +x "$WRAPPER"
      PLIST_DIR="${TMPDIR:-/tmp}"
      PLIST="$PLIST_DIR/openclaw-uninstall-$$.plist"
      cat > "$PLIST" << PLISTEOF
<?xml version="1.0"?>

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

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.

Content

Scanner excerpt · scripts/schedule-uninstall.sh (reported line 80)May include surrounding context.

sh
$EXEC_LINE
WRAPEOF
      chmod +x "$WRAPPER"
      PLIST_DIR="${TMPDIR:-/tmp}"
      PLIST="$PLIST_DIR/openclaw-uninstall-$$.plist"
      cat > "$PLIST" << PLISTEOF
<?xml version="1.0"?>