subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
cmd = [sys.executable, str(script_path(skill_name, script_name)), *(args or [])] # 默认沿用调用方当前工作目录,确保相对输出路径落在用户当前路径。 effective_cwd = cwd or Path.cwd() proc = subprocess.run( cmd, cwd=str(effective_cwd), text=True,- Confidence
- 89% confidence
- Finding
- run_skill_script executes a Python script chosen by skill_name/script_name with caller-supplied args and cwd. Although it avoids shell injection by passing a list to subprocess.run, it still provides a generic code-execution primitive inside the repository, so if untrusted input can influence the script path or arguments, this can trigger unintended local program execution and dangerous side effects.
