Skip to content

Bug 2094923 - #2845

Merged
dklawren merged 2 commits into
mozilla:masterfrom
dklawren:2094923
Nov 24, 2026
Merged

dklawren merged 2 commits into
mozilla:masterfrom
dklawren:2094923

Conversation

@dklawren

Copy link
Copy Markdown
Collaborator

Review+ carried over from private pull request
https://bugzilla.mozilla.org/show_bug.cgi?id=2094923

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@dklawren
dklawren merged commit 415810a into mozilla:master Nov 24, 2026
7 checks passed
@dklawren
dklawren deleted the 2094923 branch November 24, 2026 20:50
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.

2 participants