springboot-openai-chatgpt bussiness logic vuln
The API `api/mjkj-chat/cgform-api/addData/${chatUserID}` is used by managers to add data. However, its permission check can be bypass with arbitrary user add controller, allowing normal users to execute this API successfully by exploiting the `chatUserID` parameter, which can be found in the normal chat history.
1. A normal user logs into the system and retrieves the `chatUserID` from their chat history.
2. Without any permission validation, the user sends a request to the `addData` API, using the `chatUserID` parameter they obtained.
POST /api/mjkj-chat/cgform-api/addData/${chatUserID}
{
“data”: “malicious data”
}
Since the API lacks a proper permission check, the normal user can successfully add data on behalf of the target user.
More details can be found in the code slice
## Result
user can access the service without payment.
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步