Harden SignalR stateful reconnect. - #67409
Merged
Merged
Conversation
cincuranet
force-pushed
the
signalr-reconnect
branch
from
June 25, 2026 08:18
211058b to
06be561
Compare
This was referenced Jun 26, 2026
cincuranet
marked this pull request as ready for review
June 29, 2026 08:01
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens SignalR connection rebind behavior by rejecting requests that attempt to act on an existing connection using a different NameIdentifier, aligning stateful reconnect/long-polling behavior with the security goal in #67311 and updating tests/logging accordingly.
Changes:
- Add/adjust tests to validate 403 rejection on user-identifier mismatch for stateful reconnect, long polling poll, send, and delete.
- Replace the prior “log only” behavior with a dedicated warning log event for rejected mismatches.
- Update client functional coverage to expect a rejected stateful reconnect instead of a warning-only path.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs | Adds new unit tests covering 403 rejection + connection preservation for mismatched users across reconnect/poll/send/delete. |
| src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.AuthenticationRefresh.cs | Updates an auth-refresh-related test to reflect the new rejection behavior when auth refresh is disabled. |
| src/SignalR/common/Http.Connections/src/Internal/HttpConnectionDispatcher.Log.cs | Removes the old “username changed” log and adds a new warning log for rejected mismatches. |
| src/SignalR/common/Http.Connections/src/Internal/HttpConnectionDispatcher.cs | Implements the rejection helper and wires it into reconnect/poll/send/delete code paths. |
| src/SignalR/clients/csharp/Client/test/FunctionalTests/HubConnectionTests.cs | Updates the functional test to validate rejection (via log) when the reconnect authenticates as a different user. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
Author
|
@BrennanConroy Can you look at the Copilot comments above, please. I intentionally have the condition with |
Contributor
Author
|
@BrennanConroy This is ready for final review. |
cincuranet
force-pushed
the
signalr-reconnect
branch
from
July 16, 2026 11:38
cd88f68 to
643ecc6
Compare
BrennanConroy
approved these changes
Jul 21, 2026
javiercn
approved these changes
Jul 22, 2026
Youssef1313
approved these changes
Jul 22, 2026
Contributor
Author
|
/ba-g Failures are unrelated. |
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.
Fixes #67311. Takes into account recent #67111.