Back to skill

Security audit

手机操控 Agent (蓝蓝版)

Security checks for vulnerabilities and agentic risk

Overview

This phone-control skill is not deceptive, but it needs Review because it gives broad ADB control over a real Android device and leaves sensitive screenshots/UI dumps in temporary files without clear cleanup or confirmation safeguards.

Install only if you are comfortable giving the agent broad ADB control over an owned Android device. Avoid using it on sensitive screens, require explicit confirmation before sending messages or force-stopping apps, and clean up generated screenshots/UI dumps and /sdcard/dump.xml after use.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
agent.py:89
Finding

Insecure Temporary File Creation Exposes Sensitive Device Artifacts

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
agent.py:37
Finding

Recursive ADB Connectivity Check Causes Process Denial of Service

Content
View full analysis
is_device_connected() -> adb(['devices']) -> is_device_connected() -> adb(['devices']) -> ... ``` There is no recursion guard or low-level non-validating execution path. The calls continue until Python reaches its recursion limit and raises `RecursionError`. An initial ADB call can succeed because `DEVICE_ID` begins as an empty string and the short-circuit expression enters `find_device()` without calling `is_device_connected()`. Any subsequent ADB call in the same process encounters the recursive path. This particularly affects `get_uidump()`, which performs one ADB command to generate the XML and a second command to pull it. It also affects any library user that invokes multiple ADB-backed functions in one Python process. ### Attack Path 1. Run an operation that executes an initial ADB command and populates the global `DEVICE_ID`. 2. In the same process, execute another ADB-backed operation. 3. Because `DEV ...[truncated 1024 chars]
Remediation
View remediation
= 2 and parts[0] == DEVICE_ID: return parts[1] == 'device' return False ``` 4. Avoid substring-based status checks. Parse each `adb devices` line into its serial number and exact state so that states such as `unauthorized`, `offline`, or similarly named device identifiers are not misclassified. 5. Add regression tests for: - Two consecutive ADB calls in one process. - `get_uidump()` and its two-command workflow. - Device disconnection after `DEVICE_ID` has been assigned. - Unauthorized and offline device states. - Imported-module use where several operations share the same global state. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill clearly relies on shell/ADB execution to control a connected Android device, yet it declares no explicit tool scope or permission boundaries. That omission weakens policy enforcement and user awareness, making it easier for the skill to invoke powerful device-control commands without clear restriction or review.

Content

No source excerpt is available for this finding.

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

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

adb version

检查 skill 脚本

ls -la ~/.openclaw/skills/phone-agent/agent.py

text

---

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation instructs the agent to send messages and force-stop apps on a real user device without prominent warnings, confirmation requirements, or safeguards against unintended actions. In this context, the skill can affect communications, application state, and potentially unsaved user data, so lack of safety gating materially increases the chance of harmful or unauthorized operations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The top-level natural-language documentation and command descriptions are presented only in Chinese, which imposes a specific language choice on users without any opt-in or alternative locale support. This matches the policy category for language or locale constraints that are not optional or explicitly justified.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · agent.py (reported line 36)May include surrounding context.

python
def find_device():
    """自动查找已连接的设备"""
    result = subprocess.run(['adb', 'devices'], capture_output=True, text=True)
    lines = result.stdout.strip().split('\n')[1:]
    for line in lines:
        if 'device' in line and not 'unauthorized' in line:

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · agent.py (reported line 64)May include surrounding context.

python
for attempt in range(retry):
        try:
            if binary:
                result = subprocess.run(cmd, capture_output=True, timeout=30)
                return result.stdout, b'', result.returncode
            else:
                result = subprocess.run(cmd, capture_output=True, text=True, timeout=30)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · agent.py (reported line 67)May include surrounding context.

python
result = subprocess.run(cmd, capture_output=True, timeout=30)
                return result.stdout, b'', result.returncode
            else:
                result = subprocess.run(cmd, capture_output=True, text=True, timeout=30)
                return result.stdout, result.stderr, result.returncode
        except subprocess.TimeoutExpired:
            if attempt < retry - 1:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill captures screenshots and UI hierarchy dumps from a connected Android device and writes them to local temporary files without consent prompts, retention limits, or secure file handling. Those files can contain highly sensitive information such as messages, tokens, account data, and app content, creating a local privacy and data-exposure risk if the host is multi-user, compromised, or logs/forwards file paths.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

Force-stopping arbitrary apps is a disruptive action that can terminate active sessions, interrupt user workflows, and potentially cause data loss in apps with unsaved state. In a phone-control skill, this capability is expected, but exposing it without an explicit confirmation or safety policy increases the chance of accidental or abusive device manipulation.

Content

No source excerpt is available for this finding.