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

Commit

Permalink
fix(users): fix for users.profile.server.controller.js security (#1338)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
masterwok authored and lirantal committed Jun 18, 2016
1 parent 239ce61 commit 2ad422c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ exports.update = function (req, res) {
// For security measurement we remove the roles from the req.body object
delete req.body.roles;

// For security measurement do not use _id from the req.body object
delete req.body._id;

if (user) {
// Merge existing user
user = _.extend(user, req.body);
Expand Down

0 comments on commit 2ad422c

Please sign in to comment.