Back to skill

Security audit

openclaw-android

Security checks for vulnerabilities and agentic risk

Overview

This Android control skill is broadly useful but asks for root-level device control and can clear data, uninstall apps, capture screens, and log sensitive text without enough safeguards.

Review this before installing on any real Android device. Use it only on devices where root-level remote control is intended, avoid entering passwords or tokens through its text command, and treat clear, uninstall, install, screenshot, and ls as sensitive actions that should require explicit confirmation and careful path/package selection.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (2)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
shell.sh:15
Finding

Unnecessary and Incorrect Invocation of an Interactive Root Shell

Content
View full analysis

Vulnerability Details

File Location: shell.sh:15-17
Vulnerability Type: Excessive privilege acquisition and unsafe interactive root shell
Risk Level: High

bash
# 切换到root权限
log "切换到root权限"
su

Technical Analysis

The script invokes su globally before dispatching every supported operation. This violates least-privilege principles because operations such as listing packages, tapping coordinates, entering text, and taking screenshots do not universally require unrestricted root access.

Invoking su without a command normally starts an interactive child shell. It does not elevate the parent script or automatically cause the subsequent case statement to run as root. Consequently, the script exposes an unrestricted interactive root-command channel and then resumes its remaining commands after that shell exits, potentially under the original privileges.

The behavior also conflicts with the documented claim that the script automatically switches to root before executing subsequent commands. Root access is therefore both excessive and incorrectly implemented.

Attack Path

  1. A user or automation agent invokes shell.sh for an otherwise routine Android operation.
  2. The script executes the standalone su command.
  3. If root authorization is granted, an interactive root shell is opened.
  4. Any party capable of supplying input to that shell can execute arbitrary Android or Linux commands as root.
  5. The attacker can read or modify protected data, alter system configuration, remove applications or files, or install additional software.
  6. After the interactive shell exits, the script continues, making the privileged interaction less apparent to the caller.

Impact Assessment

Successful exploitation provides unrestricted root-level command execution on the Android device. The affected scope can include protected application data, system settings, installed packages, credentials accessible ...[truncated 174 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove the unconditional standalone su invocation.
  • Run all operations without root unless a specific command demonstrably requires elevated privileges.
  • For operations that require elevation, invoke a fixed and validated command explicitly through a non-interactive mechanism such as su -c, rather than opening an unrestricted shell.
  • Validate all command arguments before constructing any privileged operation.
  • Maintain an allowlist of privileged operations and reject unexpected commands or options.
  • Require explicit user confirmation before destructive privileged actions such as clearing application data, installing packages, or uninstalling packages.
  • Check command exit statuses and report whether privilege acquisition and the requested operation actually succeeded.
  • Document the minimum permission requirements for each supported operation.

T09 · Insecure Skill Coding Practices

Warning
Location
shell.sh:3
Finding

Sensitive Command Arguments and Text Input Are Stored in Predictable Shared-Storage Logs

Content
View full analysis

Vulnerability Details

File Location: shell.sh:3-13 and shell.sh:112-116
Vulnerability Type: Plaintext sensitive-data exposure through insecure logging
Risk Level: Medium

bash
LOG_FILE="/sdcard/Download/openclaw_$(date +%Y%m%d_%H%M%S).log"

# 写入日志函数
log() {
    echo "[$(date +%Y-%m-%d %H:%M:%S)] $1" >> "$LOG_FILE"
    echo "$1"
}

# 初始化日志
log "===== OpenClaw Android 命令执行开始 ====="
log "执行命令: $0 $@"
bash
"text")
    # 输入文本
    if [ -n "$2" ]; then
        log "输入文本: $2"
        input text "$2"

Technical Analysis

The script creates timestamp-named log files under /sdcard/Download, a shared-storage location. It records the complete command line through $@, including all supplied arguments. The text operation then records the entered value a second time.

The documented usage includes entering a password through the text operation. Passwords, tokens, personal messages, package identifiers, filesystem paths, and other sensitive UI input can therefore be persisted in plaintext. Processes or users with sufficient shared-storage access may subsequently read those values.

Timestamp-only filenames are predictable and provide no confidentiality. Depending on filesystem behavior and execution privileges, predictable paths may also create file-collision or link-redirection risks. The unconditional root-shell behavior can increase the impact if log creation is ever performed in a privileged execution context.

Attack Path

  1. A user invokes shell.sh text to enter a password, token, private message, or other sensitive value into an Android application.
  2. The script logs the complete invocation through $@.
  3. The text branch logs the sensitive value again before passing it to input text.
  4. Both records are written in plaintext to a predictable file under /sdcard/Download.
  5. Another application, connected host, local user, backup process, or diagnostic c ...[truncated 630 chars]
Remediation
View remediation

Remediation Suggestions

  • Do not log complete argument lists.
  • Never log the contents of the text operation or other fields that may contain passwords, tokens, personal data, or secrets.
  • Replace sensitive arguments with fixed redaction markers such as [REDACTED].
  • Store necessary diagnostic logs in application-private storage rather than /sdcard or /sdcard/Download.
  • Create log files atomically with collision-resistant names and restrictive permissions.
  • Add configurable log levels, with sensitive argument logging disabled in every mode.
  • Define a short retention period and securely remove obsolete logs.
  • Avoid printing sensitive values to standard output because caller-side systems may also retain console output.
  • Review existing devices for previously generated openclaw_*.log files and securely delete any logs containing confidential data.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill metadata understates the actual capability set while the body documents additional privileged operations such as app install/uninstall, app data wiping, filesystem listing, keyevent injection, and persistent logging. Because all commands are executed after switching to root, this mismatch can cause the skill to be invoked under a narrower trust assumption than its real authority, increasing the chance of destructive or privacy-impacting actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documented clear-data command irreversibly removes an application's local state, credentials, and cached content, and it is presented as a routine operation without any destructive-action warning. Given that commands are run with root privileges, accidental or unauthorized use can cause immediate data loss and service disruption on the device.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The uninstall command removes an application and may also result in loss of associated data or functionality, yet the documentation does not warn users about those consequences. In a root-enabled remote-control skill, this omission makes accidental destructive execution much more likely and could be abused to disable security tools or critical apps.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill metadata says it is for controlling Android apps and taking screenshots, but the script also exposes broader root-level device-management actions such as install, uninstall, clear app data, and filesystem browsing. This mismatch is dangerous because callers may invoke capabilities that exceed user expectations, and all commands run after a root transition, magnifying the blast radius of mistakes or abuse.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

App installation, uninstallation, and data clearing go beyond simple app interaction and can materially change device state or destroy user data. In this skill context, these capabilities are more dangerous because the description emphasizes app control actions like launching, tapping, and screenshots, not root-level package management.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says the skill is limited to listing apps, opening/closing apps, app interaction, and screenshots, but the documentation additionally supports clearing app data, installing/uninstalling packages, and listing files. This discrepancy is security-relevant because users and orchestrators may grant or trigger the skill expecting low-risk UI automation while it actually exposes privileged administrative actions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation description is broad enough to match generic Android-control requests, yet the skill executes commands as root and includes destructive package and data-management operations. Broad routing combined with privileged execution raises the risk of accidental invocation for requests that should have been handled by a less-privileged tool or after additional confirmation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation exposes root-privileged and destructive functions without clearly stating that some commands can delete data, remove apps, alter device state, or capture sensitive content. In a skill intended for remote Android control, lack of safety warnings and confirmation expectations materially increases the chance of unintended harm.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The entire skill description and usage guidance are presented only in Chinese, with no indication that users can choose another language or that the skill is intentionally limited to a Chinese-speaking context. This creates a locale/language constraint that is not opt-in or justified in the file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Screenshot capture can collect passwords, messages, tokens, financial data, or other sensitive on-screen content, but the documentation presents it without any privacy notice or handling guidance. Because images may be stored on-device and commands run with elevated privileges, misuse could expose confidential user information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The clear command irreversibly removes an app's local data without any confirmation, preview, or warning. Since the script is intended for operational device control and runs with elevated privileges, accidental or unauthorized invocation can cause immediate data loss for the targeted app.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The uninstall command removes applications without any user warning or confirmation, which can disrupt workflows and delete associated data. In a root-capable automation skill, this materially increases the risk of accidental or malicious destructive actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The screenshot command captures on-screen content and writes it to shared storage without any privacy notice or safeguards. Screens may contain credentials, personal messages, or sensitive enterprise data, and storing them on /sdcard can make them broadly accessible to other components or users with storage access.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Arbitrary filesystem listing is outside the stated app-control use case and can expose sensitive file names, directory structures, and data locations on the device. Because the script attempts to switch to root first, this browsing may reveal far more than a normal app-control helper should access.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The feature summary omits administrative and filesystem capabilities that appear later in the document. While this is primarily a documentation issue, incomplete disclosure of root-capable functions can still weaken safe review, approval, and routing decisions for the skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

Comments and log/output strings throughout the script are written in Chinese, with no option to select another language or locale. This can violate a language/locale policy when the skill is expected to be usable without forcing a specific language on users.

Content

No source excerpt is available for this finding.