subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
cmd = [openclaw_bin] + args cmd = [c for c in cmd if c] try: result = subprocess.run(cmd, capture_output=True, text=True, encoding="utf-8", errors="replace") except Exception: result = subprocess.run(cmd, capture_output=True, text=True) if result.returncode != 0:- Confidence
- 93% confidence
- Finding
- This subprocess invocation executes a binary path and arguments derived from environment variables and PATH resolution without validating the executable identity. An attacker who can influence OPENCLAW_PATH, OPENCLAW_SCRIPT, OPENCLAW_BIN, or PATH could cause the script to run a malicious program and then trust its output for later cron-job edits.
