Check user session before displaying two factor seed

Two factor seed page was not properly checking for user session, allowing an authenticated user to see everyone's 2fa seed
This commit is contained in:
Pietro Tarenzi
2022-09-16 17:14:53 +02:00
committed by GitHub
parent 66ba1e18bb
commit 24d5d5744f
2 changed files with 5 additions and 0 deletions

View File

@ -453,6 +453,10 @@ class SettingsController extends Controller
public function actionTwoFactor($id)
{
if($id != Yii::$app->user->id) {
throw new ForbiddenHttpException();
}
$choice = Yii::$app->request->post('choice');
/** @var User $user */
$user = $this->userQuery->whereId($id)->one();