vr-shopxo-plugin/plan.md

52 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# Plan — 安全审计AdminGoodsSaveHandle 数据验证逻辑
> 版本v1.0 | 日期2026-04-20 | Agentcouncil/SecurityEngineer
---
## 任务概述
`AdminGoodsSaveHandle.php` 的数据验证逻辑进行安全审计,重点调查商品保存时报错 `Undefined array key "id"` 的根因,并分析所有可能导致数据异常或未定义行为的输入点。
---
## 审计任务清单
- [x] **Task 1**: 读取 `AdminGoodsSaveHandle.php` — 定位 "Undefined array key 'id'" 最可能出现的行
- [Done: council/SecurityEngineer] → Primary: Line 77 `$r['id']`
- [x] **Task 2**: 分析 ShopXO `Db::name()` 表前缀行为 — `vr_seat_templates` vs `vrt_vr_seat_templates`
- [Done: council/SecurityEngineer] → 等价,不存在问题
- [x] **Task 3**: 分析 `find($templateId)` 返回 null 时的处理逻辑
- [Done: council/SecurityEngineer] → Secondary: Line 71 访问 `$template['seat_map']` 无空安全
- [x] **Task 4**: 分析 `$configs` JSON 解码后的类型安全性 — 数组访问下标验证
- [Done: council/SecurityEngineer] → 部分安全is_array 检查存在
- [x] **Task 5**: 分析 `selected_rooms` 数据结构与类型匹配问题
- [Done: council/SecurityEngineer] → 类型匹配正确(均为字符串),但无空安全
- [x] **Task 6**: 审计 `SeatSkuService::BatchGenerate``$data['item_type']` 访问安全性
- [Done: council/SecurityEngineer] → BatchGenerate 安全item_type 有 ?? '' 兜底
- [x] **Task 7**: 汇总根因分析,输出修复建议 → `reviews/SecurityEngineer-AUDIT.md`
- [Done: council/SecurityEngineer] → 报告已生成,含完整根因 + 修复代码
---
## 阶段划分
| 阶段 | 内容 |
|------|------|
| **Draft** | Task 1-6逐文件、逐行读取代码识别所有安全风险点 |
| **Review** | Task 7汇总根因输出结构化审计报告与修复建议 |
| **Finalize** | 提交审计报告到 main标记完成 |
---
## 依赖
- 依赖 `docs/VR_GOODS_CONFIG_SPEC.md`v3.0 JSON 格式说明)
- 不需要 BackendArchitect / DebugAgent 配合,可独立完成