Repository navigation
Bug 2094923 - #2845
Merged
Merged
Bug 2094923#2845
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
Rewriting all active session credentials across both authentication stacks requires human confirmation of the production migration and end-to-end session retention, logout, and hash-replay rejection.
No open issues 🎉
What changed in this PR
This PR hardens Bugzilla session storage by replacing raw login cookies in the database with keyed SHA-256 hashes, preventing stored values from being replayed directly as browser sessions.
Changes:
- Updates cookie creation, authentication, logout, and session management to use hashes.
- Expands cookie storage and adds a repeatable migration that preserves existing sessions.
- Adds hashing and migration tests and updates authentication fixtures.
| File | Description |
|---|---|
userprefs.cgi |
Uses hashes to identify and preserve the current session. |
t/login-cookie-hash.t |
Tests cookie hashing and repeatable migration. |
t/buglist-series-idor.t |
Stores hashed cookies in login fixtures. |
extensions/Needinfo/t/bmo/mentions-on-create.t |
Updates the login fixture to store a hash. |
Bugzilla/Token.pm |
Adds cookie generation and hashing helpers with documentation. |
Bugzilla/Install/DB.pm |
Migrates existing raw cookies to hashes. |
Bugzilla/DB/Schema.pm |
Expands the cookie column to hold 64-character hashes. |
Bugzilla/Auth/Persist/Cookie.pm |
Stores hashes during login and uses them during logout. |
Bugzilla/Auth/Login/Cookie.pm |
Hashes incoming cookies for authentication and activity updates. |
Bugzilla/App/Plugin/Login.pm |
Applies hashed-cookie authentication to the application plugin. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Review+ carried over from private pull request
https://bugzilla.mozilla.org/show_bug.cgi?id=2094923