WuYongJie 5821d73291 初始提交:3D家具安装展示系统
包含:
- furniture-3d-system:Next.js 16 全栈应用(资产中心、产品管理、3D装配动画)
- autocad-plugin:AutoCAD 家具导出插件源码
- 资产中心改造:编辑弹窗化、删除功能、Toast反馈、自定义Select组件

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 14:00:19 +08:00

1.6 KiB
Raw Blame History

title, date, module, problem_type, severity, symptoms, root_cause, resolution_type, status, confidence, tags, related_patterns
title date module problem_type severity symptoms root_cause resolution_type status confidence tags related_patterns
Hole 写/读操作缺少 Service 层产品权限护栏 2026-02-15 hole-service security_issue critical
/api/holes 与 /api/holes/[id] 依赖登录态,缺少基于产品归属的 canEditProduct/canViewProduct 校验
Route 可被绕过时,Service 直接写孔位数据,存在跨产品越权风险
权限策略停留在 Route 入参层,Service 未对 hole/panel -> product 归属做统一鉴权 code_fix active high
security
idor
permission
holes
service-layer
WF-HOLE-ROUTE-SERVICE-001

现象与影响

孔位写接口在“已登录”之后直接执行写库,读接口允许匿名访问精确结构参数。缺少产品级权限校验时,攻击者可通过可猜测 ID 读取或修改不属于自己的产品孔位数据。

修复动作

  1. 在 src/server/services/hole.service.ts 新增 requireUser/getProductForPermission/assertCanViewProduct/assertCanEditProduct。
  2. 将权限护栏接入 listByFilter/findById/findByPanelId(查看)与 create/createMany/update/delete/deleteMany/deleteByPanelId/deleteByFilter(写入)。
  3. 所有写入前都先解析 hole/panel -> product 归属,再执行 canEditProduct。

验证

  • npm run type-check -- --pretty false 通过
  • npm test -- tests/lib/cad-panel-linking.test.ts --runInBand 通过

预防策略

  • 所有“资源隶属产品”的接口统一执行“Route 鉴权入口 + Service 产品权限护栏”。
  • Service 层禁止依赖 Route 先验假设(例如“已经做过权限校验”)。