← PHP / Laravel 목차

PHP-054 / 고급

2단계 인증 상태를 세션만으로 신뢰

A07:2021 Identification and Authentication Failures · CWE-304 Missing Critical Step in Authentication

왜 문제가 될까요?

OTP 단계를 건너뛰고 /dashboard로 직접 접근하면 2FA가 무력화된다.

이렇게 수정하세요

php
session(['2fa:pending' => $user->id]);      // OTP 성공 후에만 Auth::login + regenerate()

더 읽기