subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
print(f"命令:{command}") try: result = subprocess.run( command, shell=True, capture_output=True,- Confidence
- 96% confidence
- Finding
- The script executes commands via subprocess.run with shell=True, which routes the command string through a shell interpreter. In this file the test commands are currently hardcoded, but the helper function is generic and unsafe by design: if any future caller passes user-controlled or configurable input, it becomes vulnerable to shell metacharacter injection and unintended command execution.
