subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
print(f" CMD: {' '.join(cmd)}") t0 = time.time() # shell=True needed on Windows so npx.cmd can be found result = subprocess.run(' '.join(cmd), cwd=str(PROJECT_DIR), shell=True) elapsed = time.time() - t0 if result.returncode != 0:- Confidence
- 98% confidence
- Finding
- This call builds a command string with user-influenced values and executes it with shell=True, creating a classic command injection surface. The size argument is parsed directly from CLI input and output_path includes lesson_name derived from LLM/user input, so an attacker could inject shell metacharacters and execute arbitrary commands on the host.
