subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
# 7. 发送简报给CEO try: send_cmd = f'openclaw tool call message --action send --target "{CONFIG["receiver"]}" --message "【每日早会简报 {today}】请查收今日最新资讯汇总。" --media "{full_path}"' subprocess.run(send_cmd, shell=True, capture_output=True, text=True) print("简报已成功发送给CEO") except Exception as e: print(f"发送简报失败: {str(e)}")- Confidence
- 96% confidence
- Finding
- The code constructs a shell command string and executes it with shell=True for outbound messaging. Even though the current values appear mostly static, using a shell introduces command-injection risk if CONFIG values, file paths, or future inputs become attacker-controlled, and it grants broader command-execution capability than needed for this task.
