subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
from message_tool import message # 动态导入(避免循环依赖) import subprocess result = subprocess.run( ['python3', '-c', f'from tools import message; message(action="send", channel="feishu", target="user:ou_fd61d5ebc9af22913aa4c21c8e3cac14", message="{alert_msg}")'], capture_output=True, text=True, timeout=15,- Confidence
- 95% confidence
- Finding
- The code builds a Python one-liner for subprocess execution using direct string interpolation of alert_msg inside quoted source code. If any alert content contains quotes or crafted payload text from upstream market data or other inputs, it can break out of the string literal and execute unintended Python code in the child process, turning a notification path into code execution.
