Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a6d9c3

Browse files
MatmaRexreedy
authored andcommitted
SECURITY: HTMLUserTextField: Treat hidden users as unregistered if current user can't view them
CVE-2022-41765 Bug: T309894 Change-Id: I0707153ccbdb062a6b7ce461cc535aa2af8e4576
1 parent 9b221b3 commit 2a6d9c3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎includes/htmlform/fields/HTMLUserTextField.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ public function validate( $value, $alldata ) {
5555
return $this->msg( 'htmlform-user-not-valid', $value );
5656
} elseif (
5757
// check, if the user exists, if requested
58-
( $this->mParams['exists'] && $user->getId() === 0 ) &&
58+
( $this->mParams['exists'] && !(
59+
$user->isRegistered() &&
60+
// Treat hidden users as unregistered if current user can't view them (T309894)
61+
!( $user->isHidden() && !( $this->mParent && $this->mParent->getUser()->isAllowed( 'hideuser' ) ) )
62+
) ) &&
5963
// check, if the username is a valid IP address, otherwise save the error message
6064
!( $this->mParams['ipallowed'] && IPUtils::isValid( $value ) ) &&
6165
// check, if the username is a valid IP range, otherwise save the error message

0 commit comments

Comments
 (0)