Skip to content

Commit

Permalink
Merge pull request #13931 from craftcms/bugfix/user-perms
Browse files Browse the repository at this point in the history
Fixed a potential privilege escalation bug
  • Loading branch information
brandonkelly authored Nov 16, 2023
2 parents e7fcfe8 + dfe1b83 commit be81eb6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Craft CMS 3.x

## Unreleased

- Fixed a privilege escalation vulnerability.

## 3.9.5 - 2023-10-17

- Added `pgpassword` and `pwd` to the list of keywords that Craft will look for when determining whether a value is sensitive and should be redacted from logs, etc.
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ public function actionSaveUser()
// Is the site set to use email addresses as usernames?
if ($generalConfig->useEmailAsUsername) {
$user->username = $user->email;
} else {
} elseif ($isNewUser || $currentUser->admin || $isCurrentUser) {
$user->username = $this->request->getBodyParam('username', ($user->username ?: $user->email));
}

Expand Down

0 comments on commit be81eb6

Please sign in to comment.