← PHP / Laravel · 目次

PHP-055 / 中級

「ログイン状態を保持」トークンの設計ミス

A07:2021 Identification and Authentication Failures · CWE-613 Insufficient Session Expiration

なぜ問題になるのか?

永続トークンがパスワード変更後も有効なままです。

修正方法

php
Auth::login($user, remember: true);  // Laravel の remember_token 再生成を使用し、パスワード変更時にセッションを無効化

参考資料