T09 · Insecure Skill Coding Practices
- Location
agent.py:89- Finding
Insecure Temporary File Creation Exposes Sensitive Device Artifacts
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
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.
agent.py:89Insecure Temporary File Creation Exposes Sensitive Device Artifacts
agent.py:37Recursive ADB Connectivity Check Causes Process Denial of Service
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.
Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.
adb version
ls -la ~/.openclaw/skills/phone-agent/agent.py
---
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.
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.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
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 calls execute external commands. Without careful input validation, this enables command injection.
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 calls execute external commands. Without careful input validation, this enables command injection.
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:
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.
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.