[PR #6049] [MERGED] fix(multi-session): reject cookies without valid signatures on signout hook #32008

Closed
opened 2026-04-17 22:52:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6049
Author: @Bekacru
Created: 11/17/2025
Status: Merged
Merged: 11/18/2025
Merged by: @Bekacru

Base: canaryHead: fix/multi-session


📝 Commits (2)

  • b686632 fix(multi-session): reject cookies without valid signatures on signout hook
  • f785c56 chore: remove uncessary comments

📊 Changes

2 files changed (+99 additions, -17 deletions)

View changed files

📝 packages/better-auth/src/plugins/multi-session/index.ts (+27 -17)
📝 packages/better-auth/src/plugins/multi-session/multi-session.test.ts (+72 -0)

📄 Description

Summary by cubic

Reject unsigned multi-session cookies during sign out so only verified session tokens are deleted. Prevents forged cookies from deleting other users’ sessions.

  • Bug Fixes
    • Validate multi-session cookies with getSignedCookie and delete sessions only for verified tokens.
    • Clear multi-session cookies only when their signatures are valid.
    • Added test that simulates a forged cookie; confirms the victim’s session remains intact while the attacker’s session is removed.

Written for commit f785c5671b. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6049 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 11/17/2025 **Status:** ✅ Merged **Merged:** 11/18/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/multi-session` --- ### 📝 Commits (2) - [`b686632`](https://github.com/better-auth/better-auth/commit/b686632ca19bed7de23a7584756af55ff2e35b41) fix(multi-session): reject cookies without valid signatures on signout hook - [`f785c56`](https://github.com/better-auth/better-auth/commit/f785c5671bb22d4050cde04cb8aed12c01a714f9) chore: remove uncessary comments ### 📊 Changes **2 files changed** (+99 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/multi-session/index.ts` (+27 -17) 📝 `packages/better-auth/src/plugins/multi-session/multi-session.test.ts` (+72 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Reject unsigned multi-session cookies during sign out so only verified session tokens are deleted. Prevents forged cookies from deleting other users’ sessions. - **Bug Fixes** - Validate multi-session cookies with getSignedCookie and delete sessions only for verified tokens. - Clear multi-session cookies only when their signatures are valid. - Added test that simulates a forged cookie; confirms the victim’s session remains intact while the attacker’s session is removed. <sup>Written for commit f785c5671bb22d4050cde04cb8aed12c01a714f9. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-17 22:52:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#32008