自动选择并执行仓库 README 中提取的命令会把仓库内容转化为本机代码执行
原文依据:5 处确定性编排器从 README 及最多三个本地链接文档提取命令,自动选择评分较高的目标;启用 `--run-selected` 后,该命令会直接交给本机进程运行。README 中“已文档化”并不代表命令可信。
恶意或被篡改的仓库可借安装、评测或推理命令读取或修改用户文件、启动下载、访问网络服务,或消耗大量计算资源。原生 shell 模式还会启用重定向、管道等 shell 行为。
该风险成立,但仅在用户显式启用 `--run-selected` 时发生。编排器从 README(以及最多三个本地链接文档)提取命令并自行选择目标,随后把选中的命令交给本机运行时。被写入 README 的命令并不因此可信,可能读取或修改用户文件、使用凭据或联网。用户可要求作者在执行前展示最终 argv,并仅在隔离环境中运行不受信仓库。
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)查看另外 4 个位置
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] = { ) else: run_data = maybe_run_command( repo_path, chosen["documented_command"], args.timeout, args.user_language, args.shell_mode, runtime_root, model_adapter, args.monitor_gpu, ) 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: ) 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, user_language=args.user_language, full_training_authorized=args.full_training_authorized, train_timeout=args.train_timeout, dataset_hint=dataset_hint, checkpoint_hint=checkpoint_hint, resume_from=args.resume_from, max_train_steps=args.max_train_steps, shell_mode=args.shell_mode, runtime_root=runtime_root, model_profile_json=args.model_profile_json, required_model_capabilities=args.require_model_capability, gpu_monitor_enabled=not args.no_gpu_monitor, ) else: run_data = maybe_run_command( repo_path, chosen["documented_command"], args.timeout, args.user_language, args.shell_mode, runtime_root, model_adapter, args.monitor_gpu, )