SECURITY: Fix reauth in Special:ChangeEmail
authorBrian Wolff <bawolff+wn@gmail.com>
Fri, 15 Jun 2018 08:19:49 +0000 (08:19 +0000)
committerReedy <reedy@wikimedia.org>
Thu, 6 Jun 2019 16:14:57 +0000 (16:14 +0000)
Previously you could bypass reauthentication by directly
POSTing to Special:ChangeEmail.

Bug: T197279
Change-Id: I674557351e0e91a8105c12ddf6cd30283aac9f7a

includes/specials/SpecialChangeEmail.php

index 8d5cf85..9ce8760 100644 (file)
@@ -55,14 +55,16 @@ class SpecialChangeEmail extends FormSpecialPage {
         * @param string $par
         */
        function execute( $par ) {
-               $this->checkLoginSecurityLevel();
-
                $out = $this->getOutput();
                $out->disallowUserJs();
 
                parent::execute( $par );
        }
 
+       protected function getLoginSecurityLevel() {
+               return $this->getName();
+       }
+
        protected function checkExecutePermissions( User $user ) {
                if ( !AuthManager::singleton()->allowsPropertyChange( 'emailaddress' ) ) {
                        throw new ErrorPageError( 'changeemail', 'cannotchangeemail' );