subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def run_command(cmd, timeout=600): """运行命令,返回 (success, stdout)""" try: result = subprocess.run( cmd, capture_output=True, text=True, timeout=timeout, cwd=os.getcwd(), shell=(platform.system() == "Windows") )- Confidence
- 95% confidence
- Finding
- The build/compile path constructs a single command string using values derived from configuration and then executes it with shell enabled on Windows. If an attacker can influence unity_path, execute_method, log_file, or the working directory context, they may inject shell metacharacters and achieve arbitrary command execution in the CI environment. In a CI toolkit, this is more dangerous because these scripts often run with elevated access to source code, secrets, and signing materials.
