Skip to content
This repository was archived by the owner on Aug 30, 2021. It is now read-only.

Commit 2ad422c

Browse files
masterwoklirantal
authored andcommitted
fix(users): fix for users.profile.server.controller.js security (#1338)
* Fix for users.profile.server.controller.js security (#1338) Fixes an issue where if req.body._id was not set to the current user it could potentially log the current user in as another user. Don't use req.body._id when editing user Prevents a user from being logged in as another if edit user form _id is not their own. Fixes #1338
1 parent 239ce61 commit 2ad422c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/users/server/controllers/users/users.profile.server.controller.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ exports.update = function (req, res) {
2222
// For security measurement we remove the roles from the req.body object
2323
delete req.body.roles;
2424

25+
// For security measurement do not use _id from the req.body object
26+
delete req.body._id;
27+
2528
if (user) {
2629
// Merge existing user
2730
user = _.extend(user, req.body);

0 commit comments

Comments
 (0)