fix: privilege escalation

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2019-10-31 15:42:03 +08:00
parent 6790844340
commit 0177baf916
2 changed files with 11 additions and 4 deletions

View File

@@ -160,6 +160,11 @@ func UpdateUser(req *restful.Request, resp *restful.Response) {
}
}
if usernameInHeader == user.Username {
// change cluster role by self is not permitted
user.ClusterRole = ""
}
result, err := iam.UpdateUser(&user)
if err != nil {