README 中提取的命令可在本机以当前用户权限执行
原文依据:6 处复现流程把仓库 README 和链接文档当作命令来源,自动选择目标;启用 `--run-selected` 后将所选文本交给运行器。子进程默认继承完整环境,并在仓库目录启动。仓库文档本身可能不可信,因此“文档化”不等于已安全审核。
恶意或危险的 README 命令可能修改或删除可访问文件、安装软件、使用网络,或读取进程继承的凭据。直接模式减少 shell 语法风险,但不会限制被启动程序自身的能力。
风险成立,但仅在用户显式启用 `--run-selected` 时发生。流程从 README 或其本地链接文档提取并自动选择命令,然后把所选命令交给本机运行器;运行器在目标仓库目录中启动子进程,并默认复制控制进程的完整环境。README 来源的命令虽被称为“documented”,这里没有等同于安全审核。用户应先审阅选中的实际命令,保持默认 direct 模式,并限制子进程环境或使用隔离执行器。
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 个位置
) 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, ) 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,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 fulltraining or autonomous source repair. 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.") ) 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,