From 5a942200818a213c7a269aca866f767f398afc7e Mon Sep 17 00:00:00 2001 From: rxy Date: Tue, 13 Aug 2019 18:30:38 +0900 Subject: [PATCH] SECURITY: Add permission check for suppressed account Bug: T230402 Change-Id: I6a13859be81e5c746bdf0993eb5416fecdac2306 (cherry picked from commit 4356572546b2b4e8eefda9bf10943ba1b12526b9) --- includes/specials/SpecialRedirect.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/specials/SpecialRedirect.php b/includes/specials/SpecialRedirect.php index e827911382..800604876f 100644 --- a/includes/specials/SpecialRedirect.php +++ b/includes/specials/SpecialRedirect.php @@ -79,6 +79,11 @@ class SpecialRedirect extends FormSpecialPage { if ( $user->isAnon() ) { return null; } + if ( $user->isHidden() && !MediaWikiServices::getInstance()->getPermissionManager() + ->userHasRight( $this->getUser(), 'hideuser' ) + ) { + throw new PermissionsError( null, [ 'badaccess-group0' ] ); + } $userpage = Title::makeTitle( NS_USER, $username ); return $userpage->getFullURL( '', false, PROTO_CURRENT ); -- 2.20.1