fix: harden codex home boundaries
This commit is contained in:
12
progress.md
12
progress.md
@@ -7,6 +7,7 @@
|
||||
| 2026-05-25 | 0 | coding agent | 创建文件化计划和项目基线 | 完成并通过规格审查 |
|
||||
| 2026-05-25 | 0 | review loop | 质量审查发现 docs/project.md 架构语气和 task_plan.md Phase 0 状态问题 | 已修复:改为目标架构语气,并将 Phase 0 标记为 complete |
|
||||
| 2026-05-25 | 1 | coding agent | 创建 Go 后端骨架和 Codex home 路径边界 | 已完成;未读取真实 `.codex` 数据文件 |
|
||||
| 2026-05-25 | 1 | review loop | 代码质量审查发现 symlink 绕过、敏感文件大小写、操作域 resolver、`CODEX_HOME` override 问题 | 已按 TDD 修复,并通过最终门禁 |
|
||||
|
||||
## Test Results
|
||||
|
||||
@@ -19,8 +20,19 @@
|
||||
| 2026-05-25 | `curl http://127.0.0.1:18083/api/health` | PASS_WITH_ESCALATION | 普通 sandbox localhost 请求失败;提升权限后返回 `{"status":"ok"}` |
|
||||
| 2026-05-25 | `git diff --check` | PASS | 无 whitespace error |
|
||||
| 2026-05-25 | `git status --short` | PASS | 仅本阶段文件变更和新增 |
|
||||
| 2026-05-25 | `go test ./internal/codexhome` | FAIL | TDD 红灯:新增 `ResolveAgentTOML` 测试后 API 未实现 |
|
||||
| 2026-05-25 | `go test ./internal/app` | FAIL | TDD 红灯:`CODEX_HOME` override 未生效 |
|
||||
| 2026-05-25 | `go test ./internal/app` | PASS | `CODEX_HOME` override 和默认 fallback 测试通过 |
|
||||
| 2026-05-25 | `go test ./internal/codexhome` | PASS | symlink escape、大小写敏感文件、agent TOML scoped resolver 测试通过 |
|
||||
| 2026-05-25 | `go test ./...` | PASS | 全量 Go 测试通过 |
|
||||
| 2026-05-25 | `git diff --check` | PASS | 无 whitespace error |
|
||||
| 2026-05-25 | `git status --short` | PASS | 仅本轮 Phase 1 修复文件变更 |
|
||||
|
||||
## Bug Loop
|
||||
|
||||
| Phase | Bug | Fix Attempt | Retest Result |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | `ResolveInside` 可被 `.codex/agents` symlink 指向外部目录绕过 | 检查已存在路径组件,发现 symlink 后使用 `EvalSymlinks` 并确认仍在 evaluated Codex home 内 | `go test ./internal/codexhome` PASS |
|
||||
| 1 | `AUTH.JSON` 等大小写变体未被敏感文件 denylist 拦截 | 对敏感根文件相对路径做 case-insensitive 匹配 | `go test ./internal/codexhome` PASS |
|
||||
| 1 | 缺少操作域 resolver,通用 `ResolveInside` 容易误用 | 新增 `ResolveAgentTOML`,只允许 `agents/` 直属 `.toml` 文件名 | `go test ./internal/codexhome` PASS |
|
||||
| 1 | `docs/project.md` 记录 `CODEX_HOME` 但默认配置未读取 | `DefaultConfig` 增加 `CODEX_HOME` 非空 override | `go test ./internal/app` PASS |
|
||||
|
||||
Reference in New Issue
Block a user