Back to skill

Security audit

adb controller

Security checks for vulnerabilities and agentic risk

Overview

This Android ADB controller is mostly coherent, but it needs Review because it permits broad device control, silently relies on an environment-selected target, and saves screenshots after each command.

Install only if you are comfortable giving the agent broad ADB control over the target Android device. Before use, verify which device ADB will target, avoid setting ADB_SERVER_ADDRESS to untrusted hosts, and assume screenshots saved in ~/.openclaw/workspace may contain sensitive screen contents until deleted.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (9)

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill explicitly instructs the agent to execute a local Python script via the exec tool and states that it reads configuration from openclaw.json, yet the manifest declares no tool scope or allowed-tools restrictions. In a skill that can issue arbitrary ADB arguments to a connected device, missing tool restrictions weakens containment and increases the chance of unintended shell access, unsafe invocation, or broader-than-expected execution capability.

Vague Triggers

Medium
Confidence
96% confidence
Finding
The description says to use this skill whenever the user asks to control an Android device, tap, swipe, input text, or perform actions via adb, which is a broad trigger for a highly capable action skill. Because the skill can pass arbitrary ADB arguments and affect a real device, broad activation increases the risk of accidental invocation, misuse for sensitive device operations, or execution without sufficient user confirmation for destructive actions.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The implementation diverges from the manifest by taking the ADB target from an environment variable instead of the declared openclaw.json configuration, weakening operator expectations and configuration integrity. This mismatch can make the skill easier to retarget silently, increasing the chance of unauthorized device control or data capture.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
Reading ADB_SERVER_ADDRESS from the environment and auto-connecting to a host:port can create an undisclosed outbound network connection to a remote Android device or emulator. In this skill context, that is more dangerous because it directly precedes privileged device-control operations, so a hidden retargeting of the ADB endpoint can expose both commands and collected screenshots.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
if adb_server:
        # If it looks like an IP address/port, attempt to connect first
        if ":" in adb_server:
            subprocess.run(["adb", "connect", adb_server], capture_output=True)
        base_cmd.extend(["-s", adb_server])
        
    cmd = base_cmd + args
Confidence
90% confidence
Finding
The script passes an environment-derived adb_server value directly into an adb connect operation, allowing external configuration to trigger network connections to attacker-controlled hosts or unintended devices. Although this is not shell injection, it can redirect the skill to a rogue ADB endpoint and cause commands and screenshots to be sent to the wrong target.

Tainted flow: 'adb_server' from os.environ.get (line 15, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Content
if adb_server:
        # If it looks like an IP address/port, attempt to connect first
        if ":" in adb_server:
            subprocess.run(["adb", "connect", adb_server], capture_output=True)
        base_cmd.extend(["-s", adb_server])
        
    cmd = base_cmd + args
Confidence
94% confidence
Finding
Untrusted data from ADB_SERVER_ADDRESS flows into a code path that initiates an ADB connection, enabling environment manipulation to change the device target or establish outbound connections. In this skill, that is especially sensitive because subsequent device-control commands and screenshot capture may operate on an unintended or malicious endpoint.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
print(f"Running: {' '.join(cmd)}")
    
    try:
        result = subprocess.run(cmd, check=True, capture_output=True, text=True)
        print(result.stdout)
        if result.stderr:
            print(result.stderr, file=sys.stderr)
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The script automatically captures and stores a device screenshot after every ADB command, which can persist sensitive screen contents such as messages, credentials, health data, or tokens to disk without user awareness. In an Android-control skill, this materially increases privacy risk because screenshots are taken routinely and retained in a predictable workspace directory.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
screencap_cmd = base_cmd + ["exec-out", "screencap", "-p"]
    try:
        with open(screenshot_path, "wb") as f:
            subprocess.run(screencap_cmd, stdout=f, check=True)
        print(f"Screenshot saved to: {screenshot_path}")
    except Exception as e:
        print(f"Failed to take screenshot: {e}", file=sys.stderr)
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Static analysis

No suspicious patterns detected.