subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
path = os.path.join(base_dir, "games", game, f"{game}.py") if os.path.exists(path): args = [sys.executable, path] + sys.argv[3:] subprocess.run(args, cwd=base_dir) else: print(_('game_not_found', game=game)) return- Confidence
- 86% confidence
- Finding
- This subprocess invocation executes a Python file selected from user-controlled CLI input (`game = sys.argv[2]`) without any allowlist or validation beyond path existence. Although `shell=False` avoids shell injection, the code still grants arbitrary local code execution for any script placed under `games/<name>/<name>.py`, which is dangerous in a skill context because it turns the skill into a launcher for untrusted code.
