subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
# Safer launch: list form + explicit new console. Avoids outer shell=True f-string injection. # The inner title + cd + python is still passed to cmd /k, but inputs are sanitized. inner_args = ["cmd", "/k", f'title {title} && cd /d "{HERE}" && {" ".join(base_cmd)}'] proc = subprocess.Popen( inner_args, creationflags=getattr(subprocess, "CREATE_NEW_CONSOLE", 0) )- Confidence
- 92% confidence
- Finding
- proc = subprocess.Popen( inner_args, creationflags=getattr(subprocess, "CREATE_NEW_CONSOLE", 0) )
