Skip to content

Commit 2e6a99b

Browse files
committed
Fix bug where a password could get changed without providing the old password
The password plugin uses loose comparison, leading to a type juggling vulnerability that allows password changes without knowing the old password in specific cases. Reported by flydragon777
1 parent 618c542 commit 2e6a99b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- Security: Fix pre-auth arbitrary file write via unsafe deserialization in redis/memcache session handler
6+
- Security: Fix bug where a password could get changed without providing the old password
67

78
## Release 1.5.13
89

plugins/password/password.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,10 @@ private function _compare($curpwd, $newpwd, $type)
333333
else {
334334
switch ($type) {
335335
case PASSWORD_COMPARE_CURRENT:
336-
$result = $curpwd != $newpwd ? $this->gettext('passwordincorrect') : null;
336+
$result = $curpwd !== $newpwd ? $this->gettext('passwordincorrect') : null;
337337
break;
338338
case PASSWORD_COMPARE_NEW:
339-
$result = $curpwd == $newpwd ? $this->gettext('samepasswd') : null;
339+
$result = $curpwd === $newpwd ? $this->gettext('samepasswd') : null;
340340
break;
341341
default:
342342
$result = $this->gettext('internalerror');

0 commit comments

Comments
 (0)