Skip to content

Bind SignalR connections to negotiated identity - #70450

Merged
rbhanda merged 2 commits into
mainfrom
security/cve-2026-114146-main
Nov 10, 2026
Merged

rbhanda merged 2 commits into
mainfrom
security/cve-2026-114146-main

Conversation

@rbhanda

@rbhanda rbhanda commented Nov 10, 2026

Copy link
Copy Markdown
Contributor
  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making.

Description

Bind a SignalR connection to the identity established during negotiation. Transport and authentication-refresh requests from a different identity are rejected, while equivalent principals continue to work.

This addresses CVE-2026-114146.

Validation

Focused regression coverage is included. Managed tests were not completed locally because the current repository bootstrap selected an MSBuild version below the repository SDK minimum; normal PR CI is required before merge.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: fdac132c-0926-4fda-8c97-88ae5b59b9fd
@github-actions github-actions Bot added the area-signalr Includes: SignalR clients and servers label Nov 10, 2026
@rbhanda
rbhanda marked this pull request as ready for review November 10, 2026 19:27
Copilot AI balanced review requested due to automatic review settings November 10, 2026 19:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Concurrent refresh/transport identity publication and Windows principal ownership changes require human review and CI evidence because managed regressions and Windows handle lifetimes were not runtime-validated.

No open issues 🎉

What changed in this PR

This PR binds SignalR’s HTTP connections to the identity established during negotiation, adding identity checks across transport initialization and authentication refresh while preserving equivalent-principal matching.

Changes:

  • Adds immutable identity snapshots with preferred-claim, authenticated-claim, and name-based matching.
  • Integrates negotiated identity tracking, request validation, and retained Windows identity cleanup into the connection lifecycle.
  • Adds regression coverage for identity matching, transport startup, stale tokens, and concurrent refreshes.

The PR reports that local managed tests were blocked by an MSBuild/SDK mismatch; CI validation remains necessary.

File Description
src/​SignalR/​common/​Http.Connections/​test/​HttpConnectionDispatcherTests.cs Tests negotiated identity matching and send validation across transports.
src/​SignalR/​common/​Http.Connections/​test/​HttpConnectionDispatcherTests.ConnectionBindingRefresh.cs Adds hosted tests for token expiration differences and competing initialization requests.
src/​SignalR/​common/​Http.Connections/​test/​HttpConnectionDispatcherTests.AuthenticationRefresh.cs Covers pre-connect refreshes, Windows identities, stale tokens, and refresh races.
src/​SignalR/​common/​Http.Connections/​src/​Internal/​UserIdentitySnapshot.cs Captures and compares immutable identity information.
src/​SignalR/​common/​Http.Connections/​src/​Internal/​HttpConnectionManager.cs Passes negotiated principals into connection creation.
src/​SignalR/​common/​Http.Connections/​src/​Internal/​HttpConnectionDispatcher.cs Captures negotiation identity and validates transport and refresh requests.
src/​SignalR/​common/​Http.Connections/​src/​Internal/​HttpConnectionContext.cs Tracks negotiated identity state and manages principal ownership and cleanup.

Review effort: Balanced

@PureWeen

Copy link
Copy Markdown
Member

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Source-only review of frozen head 7c4d95b96b1974dbabfa8bbbcb03f0bd6ab733a6.

The routed cross-cutting guide completed. Its sole concrete candidate was independently verified and discarded: the merge base did not bind the negotiate principal before the first transport request, so the proposed Cookie-to-Bearer fallback-claim sequence was accepted by both old and new code. No verified or unresolved new defect remains. Frozen existing feedback contained no equivalent concrete finding; deduplication is not an endorsement of prior feedback.

Runtime, test, CI, browser, and sample execution were excluded by the supplied source-only policy; security assessment was excluded by assigned guidance. SignalR-specific domain review was not routed, so materially changed SignalR identity-binding behavior remains uncovered by a specialist guide. Evidence is limited to tracked frozen source bytes, the complete frozen diff, projected metadata, and feedback prepared in the bundle; no feedback posted after preparation is observable.

Generated by ASP.NET Core Pull Request Review for #70450 · copilot · gpt56 · 156.2 AIC · ⌖ 21.4 AIC · ⊞ 18.8K
Comment /review to run again

{
return current._allAuthenticatedClaims is not null
&& incoming._allAuthenticatedClaims is not null
&& current._allAuthenticatedClaims.AsSpan().SequenceEqual(incoming._allAuthenticatedClaims);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[DISCARDED] Authentication-type omission does not regress the first-transport sequence

Why discarded: At the merge base, HttpConnectionDispatcher did not retain or compare the negotiate principal; the first transport request started with connection.User == null and installed its own principal. Therefore a negotiate principal with an employeeId claim under Cookie followed by the same claim under Bearer proceeds both before and after this change.

Minimal repro: Negotiate a long-polling connection with new ClaimsIdentity([new Claim("employeeId", "1")], "Cookie"), then issue the first transport GET with the same claim under "Bearer".

What goes wrong: Nothing regresses on this sequence; both frozen old and head behavior accept the request.

Fix: none

@rbhanda
rbhanda enabled auto-merge November 10, 2026 22:29
@rbhanda
rbhanda merged commit f9e9de7 into main Nov 10, 2026
32 checks passed
@rbhanda
rbhanda deleted the security/cve-2026-114146-main branch November 10, 2026 22:59
@rbhanda
rbhanda temporarily deployed to copilot-pat-pool November 10, 2026 22:59 — with GitHub Actions Inactive
@rbhanda
rbhanda temporarily deployed to copilot-pat-pool November 10, 2026 22:59 — with GitHub Actions Inactive
@rbhanda
rbhanda temporarily deployed to copilot-pat-pool November 10, 2026 23:00 — with GitHub Actions Inactive
@rbhanda
rbhanda temporarily deployed to copilot-pat-pool November 10, 2026 23:01 — with GitHub Actions Inactive
@rbhanda
rbhanda temporarily deployed to copilot-pat-pool November 10, 2026 23:03 — with GitHub Actions Inactive
@rbhanda
rbhanda temporarily deployed to copilot-pat-pool November 10, 2026 23:03 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ This pull request wasn't processed automatically.

This change requires specialized review. Please confirm whether documentation updates are needed and handle them through the appropriate process.

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 7c4d95b9 Deployed Nov 10, 2026 by rbhanda via conclusion #281
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-signalr Includes: SignalR clients and servers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants