T03 · Remote Payload Retrieval and Execution
- Location
scripts/deploy_open_autoglm.py:47- Finding
Automatic Retrieval and Execution of Unpinned Upstream Code
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This phone-automation skill is useful but needs Review because it can install and update code, remember and reconnect to devices, expose model keys, and carry out phone actions with limited confirmation.
Install only if you are comfortable with a skill that can change local tooling, download and run upstream code, control a connected phone, remember device connection details, and perform the phone task you requested without a final confirmation. Use a dedicated test phone/account where possible, prefer HTTPS model endpoints, avoid shared machines, rotate any exposed model key, and clear ~/.openclaw/workspace/.device-memory/zhiyierxing-auto-phone.json if you do not want device reuse.
scripts/deploy_open_autoglm.py:47Automatic Retrieval and Execution of Unpinned Upstream Code
scripts/run_phone_task.py:34Model API Key Exposed in Child-Process Command-Line Arguments
scripts/verify_open_autoglm.py:7Bearer Credential Can Be Transmitted over Plaintext HTTP
Unlike the other mismatch findings, this one notes persistent local device-memory behavior that is not clearly surfaced in the declaration. Persisting device identifiers and Wi‑Fi targets can create privacy and targeting risks, especially on shared hosts, because future runs may silently reconnect to or act on a remembered phone.
Unlike the other mismatch findings, this one notes persistent local device-memory behavior that is not clearly surfaced in the declaration. Persisting device identifiers and Wi‑Fi targets can create privacy and targeting risks, especially on shared hosts, because future runs may silently reconnect to or act on a remembered phone.
Unlike the other mismatch findings, this one notes persistent local device-memory behavior that is not clearly surfaced in the declaration. Persisting device identifiers and Wi‑Fi targets can create privacy and targeting risks, especially on shared hosts, because future runs may silently reconnect to or act on a remembered phone.
Unlike the other mismatch findings, this one notes persistent local device-memory behavior that is not clearly surfaced in the declaration. Persisting device identifiers and Wi‑Fi targets can create privacy and targeting risks, especially on shared hosts, because future runs may silently reconnect to or act on a remembered phone.
Unlike the other mismatch findings, this one notes persistent local device-memory behavior that is not clearly surfaced in the declaration. Persisting device identifiers and Wi‑Fi targets can create privacy and targeting risks, especially on shared hosts, because future runs may silently reconnect to or act on a remembered phone.
Unlike the other mismatch findings, this one notes persistent local device-memory behavior that is not clearly surfaced in the declaration. Persisting device identifiers and Wi‑Fi targets can create privacy and targeting risks, especially on shared hosts, because future runs may silently reconnect to or act on a remembered phone.
Unlike the other mismatch findings, this one notes persistent local device-memory behavior that is not clearly surfaced in the declaration. Persisting device identifiers and Wi‑Fi targets can create privacy and targeting risks, especially on shared hosts, because future runs may silently reconnect to or act on a remembered phone.
Unlike the other mismatch findings, this one notes persistent local device-memory behavior that is not clearly surfaced in the declaration. Persisting device identifiers and Wi‑Fi targets can create privacy and targeting risks, especially on shared hosts, because future runs may silently reconnect to or act on a remembered phone.
Unlike the other mismatch findings, this one notes persistent local device-memory behavior that is not clearly surfaced in the declaration. Persisting device identifiers and Wi‑Fi targets can create privacy and targeting risks, especially on shared hosts, because future runs may silently reconnect to or act on a remembered phone.
The skill instructs automatic cloning, installation, environment repair, device connection changes, and task execution on a connected phone, yet it lacks a clear user-facing warning that these actions will modify the host and device. That is dangerous because users may believe they are only asking a question while the skill is authorized to make persistent system changes and perform external actions in apps.
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
def run(cmd, cwd=None):
return subprocess.run(cmd, cwd=cwd, env=os.environ.copy())
def venv_matches_selected(repo_dir: Path, selected_path: str) -> bool:
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
def run(cmd, cwd=None):
return subprocess.run(cmd, cwd=cwd, env=os.environ.copy())
def venv_matches_selected(repo_dir: Path, selected_path: str) -> bool:
This helper forwards the entire environment to every captured subprocess execution. That pattern can unnecessarily expose secrets to downstream scripts and tools that have no need for them, increasing accidental disclosure risk.
def run(cmd, cwd=None, check=False, capture=False):
if capture:
return subprocess.run(cmd, cwd=cwd, env=os.environ.copy(), check=check, capture_output=True, text=True)
return subprocess.run(cmd, cwd=cwd, env=os.environ.copy(), check=check)
Passing os.environ.copy() to child processes indiscriminately forwards all parent environment variables, which may include API keys, tokens, proxy credentials, CI secrets, or other sensitive values unrelated to the task. In a deployment/orchestration skill that launches multiple helper scripts, this broad propagation expands the blast radius if any child process logs, leaks, or misuses inherited secrets.
def run(cmd, cwd=None, check=False, capture=False):
if capture:
return subprocess.run(cmd, cwd=cwd, env=os.environ.copy(), check=check, capture_output=True, text=True)
return subprocess.run(cmd, cwd=cwd, env=os.environ.copy(), check=check)
def classify_recheck(repo_dir: Path, device_type: str) -> str:
The 'adb devices' call does not need access to model credentials or most ambient environment variables, yet it inherits them all. While the command itself is harmless, broad secret propagation to unnecessary child processes is still a real exposure and poor secret-handling practice.
return 'config'
if device_type == 'android':
adb = subprocess.run(['adb', 'devices'], capture_output=True, text=True, env=os.environ.copy())
lines = [line.strip() for line in adb.stdout.splitlines()[1:] if line.strip()]
authorized = [line.split()[0] for line in lines if len(line.split()) >= 2 and line.split()[1] == 'device']
if not authorized:
The host-tools installer is given the full parent environment even though most secrets are unrelated to package installation. This creates unnecessary exposure to helper tools and installers, which may generate logs or invoke further subprocesses.
print('[phase] install host tools if needed')
install_script = root_dir / 'scripts' / 'install_host_tools.py'
if install_script.exists():
install = subprocess.run([sys.executable, str(install_script), device_type], env=os.environ.copy())
if install.returncode == 0:
print('[auto-fixed] host tools step completed without fatal errors')
else:
The deployment script inherits the full environment, which likely includes model credentials and other secrets. Because deployment/repair scripts are often verbose and complex, the chance of accidental logging or downstream propagation is elevated in this skill context.
print('[phase] deployment / repair')
deploy_script = root_dir / 'scripts' / 'deploy_open_autoglm.py'
deploy = subprocess.run([sys.executable, str(deploy_script), device_type, model_mode, str(repo_dir)], env=os.environ.copy())
if deploy.returncode != 0:
print('[runtime-failed] deployment / repair exited with a non-zero code')
return deploy.returncode
The code takes credential-bearing environment values and feeds them directly into a subprocess invocation, including exposing the API key as a command-line flag. In a product-grade deployment skill that automates local setup and execution, this is more dangerous because it normalizes handling secrets in ways that can leak them through process listings, crash reports, telemetry, or debug output.
print('[phase] model verification')
py = venv_python(repo_dir)
verify = subprocess.run([
str(py), str(root_dir / 'scripts' / 'verify_open_autoglm.py'),
'--base-url', os.environ.get('MODEL_BASE_URL', ''),
'--model', os.environ.get('MODEL_NAME', ''),
This call both forwards the full environment and passes an API key explicitly on the command line, creating two avenues for secret exposure. In local automation contexts, child processes and support tooling may emit diagnostics or be inspectable by other local users, making credential leakage realistically exploitable.
'--model', os.environ.get('MODEL_NAME', ''),
'--apikey', os.environ.get('MODEL_API_KEY', ''),
'--task', '请输出一个最简单的 do(action="Wait", duration="1 seconds") 来验证动作格式'
], cwd=str(repo_dir), env=os.environ.copy())
if verify.returncode != 0:
print('[runtime-failed] model verification failed')
print('[safe-to-retry] verify model endpoint settings or service health, then rerun the workflow')
The skill declares broad operational behavior that implies shell, network, environment, and filesystem access, but it does not declare an explicit tool/permission scope. That makes the execution boundary unclear to users and reviewers, increasing the chance of over-privileged execution and unsafe side effects such as cloning repos, modifying local environments, and interacting with connected phones without a narrowly constrained allowlist.
The skill repeatedly instructs the agent not to ask the user before proceeding and to push setup and execution forward automatically until blocked. In the context of shell, network, filesystem, environment-variable use, and phone control, that autonomy can lead to unapproved installs, repo modifications, endpoint usage, and actions on the user's mobile apps before meaningful informed consent is obtained.
- automatically reuse any existing repo, `.venv`, installed dependencies, device connection, and model env vars
- only ask the user to do something after a real runtime blocker is observed
- do not front-load setup instructions "just in case"
- do not ask the user to install ADB Keyboard, enable debugging, or configure env vars unless the workflow actually proves that those are the blockers
## Environment variables
This skill expects the following variables when applicable:
The activation guidance is intentionally broad enough to trigger on ordinary 'use my phone to do X' requests, which can cause the skill to initiate repo changes, device interactions, and external actions without a clear boundary or explicit opt-in. In a skill that can automate actions on real mobile apps and connected devices, ambiguous invocation materially increases the risk of unintended or unsafe execution.
This section expands autonomous behavior to include automatic reuse of remembered device identity and ADB Wi‑Fi targets, plus automatic enabling of TCP/IP connectivity for previously authorized devices. In practice, that can silently reconnect to and operate the wrong phone, broaden device exposure over the network, and reduce user awareness of which device is being controlled.
- existing model environment variables
- remembered Android device identity and remembered ADB Wi‑Fi target
Do not ask the user to reinstall or reconfigure something that may already be present.
For Android:
- if a previously authorized USB device is connected, try enabling TCP/IP and connecting over Wi‑Fi automatically
The skill instructs users to enable Developer Options, USB debugging, security-related debugging settings, and alternate device-connection mechanisms, but it does not warn about the increased attack surface or advise disabling them after setup. These settings can allow unauthorized device control, data access, or broader local compromise if the connected computer, cable path, or network environment is untrusted. In this deployment-focused skill, the risk is contextually relevant because the instructions are likely to be followed verbatim by non-expert users.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
return 1
print('[step] checking adb devices')
subprocess.run(['adb', 'devices'])
devices = run(['adb', 'devices'])
lines = [line.strip() for line in devices.stdout.splitlines()[1:] if line.strip()]
authorized = [line.split()[0] for line in lines if len(line.split()) >= 2 and line.split()[1] == 'device']