Skip to content

[12.x] Ensure password hash matches stored cookie before authenticating the user - #61386

Merged
taylorotwell merged 3 commits into
12.xfrom
12/SECO-414-2
Sep 1, 2026
Merged

taylorotwell merged 3 commits into
12.xfrom
12/SECO-414-2

Conversation

@crynobone

@crynobone crynobone commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

No description provided.

@crynobone crynobone changed the title [12.x] Ensure password hash matches stored cookie before authenticating [12.x] Ensure password hash matches stored cookie before authenticating the user Sep 1, 2026
@crynobone
crynobone marked this pull request as ready for review September 1, 2026 05:09
Signed-off-by: Mior Muhammad Zaki <[email protected]>
Comment thread src/Illuminate/Auth/SessionGuard.php Resolved
@taylorotwell
taylorotwell merged commit 7d1089d into 12.x Sep 1, 2026
71 checks passed
@taylorotwell
taylorotwell deleted the 12/SECO-414-2 branch September 1, 2026 13:13
binaryfire added a commit to hypervel/components-backup that referenced this pull request Oct 1, 2026
Port Laravel framework #61386 and its pinned missing-user follow-up. A remember-token match must also match the current password HMAC before the guard restores the session or emits a login event. Derive viaRemember from the validated user so rejected cookies cannot report successful remembered authentication.

Retain the HMAC-only policy and nullable-password support. The check uses the existing request-local state, adds no database lookup, and runs only after a remember-cookie candidate is found. Preserve ordinary session-ID and cached-user paths.

Adapt the existing success test, cover missing users and stale or legacy cookie hashes, and clarify password-hash and application-key invalidation in the authentication and encryption documentation.

Validated with AuthGuardTest, Auth/Session/Sanctum ParaTest suites, SQLite user-session lifecycle and logout-rehash integration tests, scoped formatting, full source/type PHPStan, and diff checks.

Upstream: laravel/framework#61386
Source: 01d008c9b5f32cb7c5e50a9a22273113d810b2a2
Follow-up: 3005430f720b659846b72ec2e8c8446945ca9472
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants