M7-11 P0 | deleteSession / updateSession / getMessages 缺少 userId 鉴权 #99
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
发现位置
代码审查
rag-chat.service.ts发现 3 个端点缺少用户身份校验。deleteSession (L259)
updateSession (L268)
getMessages (L114)
修复方案
deleteSession增加 userId 参数 →findUnique({ id, userId })校验所有权 → 403 或 404updateSession增加 userId 参数 →findUnique({ id, userId })校验所有权 → 403 或 404getMessages增加 userId 参数 → 先查 session 校验所有权 → 403 或 404String(user.id)涉及文件
修复
涉及: rag-chat.service.ts + rag-chat.controller.ts