Skip to content

fix: security hardening for SignalR hub authentication and group subscription - #62

Merged
engineering87 merged 5 commits into
mainfrom
develop
Aug 19, 2026
Merged

fix: security hardening for SignalR hub authentication and group subscription#62
engineering87 merged 5 commits into
mainfrom
develop

Conversation

@engineering87

Copy link
Copy Markdown
Owner

Summary

This PR introduces security hardening fixes for WART-Core related 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.

  • Added IsGroupSubscriptionAllowed() virtual guard to WartHubBase
  • WartHub blocks group subscriptions entirely (unauthenticated hub)
  • WartHubJwt and WartHubCookie allow 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.

🔑 Hardening: JWT validation

  • AddJwtMiddleware now accepts optional validIssuer and validAudience parameters
  • Fully backward compatible

📦 Version bump: 7.0.07.1.0

Testing

  • ✅ All 71 existing tests pass with no regressions
  • ✅ Build clean, no unexpected warnings

- 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
@github-advanced-security

Copy link
Copy Markdown

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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@engineering87
engineering87 merged commit 8307a4e into main Aug 19, 2026
5 of 6 checks passed
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