执行开关可运行从仓库文档提取的命令,而目标代码没有操作系统级隔离
原文依据:6 处编排器从 README 及最多三个链接文档中提取命令,自动选择候选;启用 `--run-selected` 后,它会把选中的字符串交给本机 subprocess。默认 direct 模式避免 shell 元字符解释,但不会限制被启动程序的文件、进程或网络能力。
恶意或已被篡改的仓库可把破坏性程序伪装成推理、评测或训练命令。执行后,该程序拥有当前用户授予进程的主机权限,可能修改项目或其他可访问文件、启动子进程,或使用可用网络。
该风险成立,但只有用户显式启用 `--run-selected` 时才会执行。编排器会从 README 提取命令并自动选择一个目标,随后将该命令交给本机运行时。默认 direct 模式减少 shell 元字符解释,但被启动的程序仍不受操作系统沙箱约束,可按其自身权限访问文件和网络。用户应只对可信仓库启用执行,并先检查最终选中的命令;需要更强保护时,应要求隔离执行环境。
scan_data = run_json(scan_script, ["--repo", str(repo_path), "--json"]) readme_path = scan_data.get("readme_path") command_data: Dict[str, Any] = {"commands": [], "counts": {}, "warnings": []} if readme_path: command_data = run_json(extract_script, ["--readme", readme_path, "--json"]) command_data = delegate_to_docs(readme_path, extract_script, command_data)查看另外 5 个位置
chosen = choose_goal(command_data.get("commands", []), repo_path) dataset_hint = derive_dataset_hint(asset_data) checkpoint_hint = derive_checkpoint_hint(asset_data) run_data: Dict[str, Any] = { ) elif args.run_selected: if chosen["selected_goal"] == "training": run_data = maybe_run_training( repo_path=repo_path, command=chosen["documented_command"], train_script=train_execute_script, lane=args.lane, try: argv = build_command(command, shell_mode) environment = dict(os.environ if child_env is None else child_env) spec["requested_argv"] = list(argv) atomic_write_json(run_dir / "spec.json", spec) if shell_mode == "direct": argv = resolve_direct_argv(argv, repo, environment) spec["argv"] = list(argv) atomic_write_json(run_dir / "spec.json", spec) creationflags = subprocess.CREATE_NEW_PROCESS_GROUP if os.name == "nt" else 0 process = subprocess.Popen( argv, env=environment, cwd=repo, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, encoding="utf-8", errors="replace", bufsize=1, creationflags=creationflags, start_new_session=os.name != "nt", ) except (FileNotFoundError, ShellSyntaxRequired, OSError, ValueError) as exc: parser.add_argument("--user-language", default="en", help="Language tag for human-readable reports.") parser.add_argument("--run-selected", action="store_true", help="Execute the selected documented command.") parser.add_argument("--include-analysis-pass", action="store_true", help="Run analyze-project and record its outputs in the stage ledger.")This is local execution with credential environment filtering, not an OS sandbox.Approved programs can access the host and network; use only trusted repositoriesuntil an isolated executor is configured. Commands that change scientificconditions must be explicitly reviewed. P1 targets small evaluations, not full