fix: security hardening for SignalR hub authentication and group subscription - #62
Merged
Conversation
- WartHubBase: add IsGroupSubscriptionAllowed() virtual guard on AddToGroup - WartHub: override IsGroupSubscriptionAllowed() to block group subscriptions on unauthenticated hub - WartHubJwt/WartHubCookie: allow group subscription only for authenticated principals - Mark AddWartMiddleware() (no-arg) as [Obsolete] with security warning - Mark UseWartMiddleware() no-arg, string and IEnumerable overloads as [Obsolete] - Mark HubType.NoAuthentication as [Obsolete] with security warning - JWT: add optional validIssuer/validAudience parameters to AddJwtMiddleware - Bump version to 7.1.0
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
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.
Summary
This PR introduces security hardening fixes for
WART-Corerelated to SignalR group subscription authorization and unauthenticated event broadcast.Changes
🔒 Fix: Unauthorized SignalR group subscription
Any client could self-assign to an arbitrary SignalR group via query string with no authorization check, on all three hub variants.
IsGroupSubscriptionAllowed()virtual guard toWartHubBaseWartHubblocks group subscriptions entirely (unauthenticated hub)WartHubJwtandWartHubCookieallow group subscription only for authenticated principals🔒 Fix: Unauthenticated broadcast of API data
The default configuration mapped an unauthenticated SignalR hub broadcasting full API request/response payloads to every connected client with no credential check.
HubType.NoAuthentication,AddWartMiddleware()and all no-authUseWartMiddleware()overloads marked[Obsolete]with security warning🔑 Hardening: JWT validation
AddJwtMiddlewarenow accepts optionalvalidIssuerandvalidAudienceparameters📦 Version bump:
7.0.0→7.1.0Testing