liukuo362573 / YiShaAdmin

基于 .NET Core MVC 的权限管理系统,代码易读易懂、界面简洁美观
MIT License
2.43k stars 875 forks source link

密码重置权限漏洞 #117

Closed CatcherX closed 2 years ago

CatcherX commented 2 years ago

Overview of the problem

权限漏洞,修改他人的密码

Description

https://github.com/liukuo362573/YiShaAdmin/blob/43f57456a740ff75c50c49ca3abbce5dc0dc62d2/YiSha.Web/YiSha.Admin.Web/Areas/OrganizationManage/Controllers/UserController.cs#L133

User的Id由客户端传过来的,会有权限漏洞:若当前登录用户有重置密码的权限,只要知道别人的用户编号,就能修改密码?

Steps to reproduce

创建一个子部门,分配重置密码的权限

Expected behavior

只能修改自己部门用户的密码

Actual behavior

只要传入用户id,就可以修改密码

liukuo362573 commented 2 years ago

这个期望的行为涉及到了具体业务,自己实现吧。