subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
first_url = next(iter(clip_urls.values())) event_text = f"[demo-slap] Render done. JobID: {job_id}. ChatID: {chat_id}. Clip URL: {first_url}. Watchdog should send media to ChatID." try: subprocess.run(["openclaw", "system", "event", "--text", event_text, "--mode", "now"], check=True) except Exception as e: print(f"⚠️ System event failed: {e}")- Confidence
- 91% confidence
- Finding
- The subprocess invocation itself is not shell-injection prone because it uses an argument list, but it does launch an external system-level command with user- and API-derived data (`chat_id`, clip URL). That creates an unnecessary trust boundary crossing and a side effect outside the stated rendering function, enabling unintended notification, data propagation, or abuse if the downstream `openclaw` command has broader privileges.
