Repository navigation
Fix SignalR fallback authorization for non-authorization metadata - #69683
Open
utsavjain2809 wants to merge 1 commit into
Open
utsavjain2809 wants to merge 1 commit into
utsavjain2809 wants to merge 1 commit into
Conversation
Contributor
|
Thanks for your PR, @utsavjain2809. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Contributor
|
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
|
Commenter does not have sufficient privileges for PR 69683 in repo dotnet/aspnetcore |
Author
|
Hi @halter73 @BrennanConroy , just a gentle follow-up on this PR, as it has been awaiting review for around 3 weeks. Whenever you get a chance, I would appreciate your review and feedback. Please let me know if any further changes are needed. Thanks for your time! |
lahma
added a commit
to quartznet/quartznet
that referenced
this pull request
Nov 3, 2026
…es not hold them to a fail-closed FallbackPolicy ASP.NET Core 11 reads every custom attribute on a hub method as authorization metadata, and a method with any attribute but none that names a policy is authorized against the host's FallbackPolicy, whatever the hub's endpoint allows (dotnet/aspnetcore#69624, which dotnet/aspnetcore#67765 introduced and dotnet/aspnetcore#69683 proposes to fix). An async method has one, AsyncStateMachineAttribute, so under a fail-closed policy the agent hub's Register refused every agent its token check had let in, and the live-events hub's JoinScheduler would refuse an anonymous dashboard. No endpoint lost its AllowAnonymous: negotiate and the transport both carry it on 11. Register, Events and JoinScheduler now hand their awaiting to private methods. The token check is the hub's own, unchanged: a wrong token and a token in the query string are still refused. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LGkLQvYPaRLpBF3dTvpE6T
lahma
added a commit
to quartznet/quartznet
that referenced
this pull request
Nov 3, 2026
…es not hold them to a fail-closed FallbackPolicy ASP.NET Core 11 reads every custom attribute on a hub method as authorization metadata, and a method with any attribute but none that names a policy is authorized against the host's FallbackPolicy, whatever the hub's endpoint allows (dotnet/aspnetcore#69624, which dotnet/aspnetcore#67765 introduced and dotnet/aspnetcore#69683 proposes to fix). An async method has one, AsyncStateMachineAttribute, so under a fail-closed policy the agent hub's Register refused every agent its token check had let in, and the live-events hub's JoinScheduler would refuse an anonymous dashboard. No endpoint lost its AllowAnonymous: negotiate and the transport both carry it on 11. Register, Events and JoinScheduler now hand their awaiting to private methods. The token check is the hub's own, unchanged: a wrong token and a token in the query string are still refused. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LGkLQvYPaRLpBF3dTvpE6T (cherry picked from commit 7ec865d)
Merged
6 of 8 tasks
ryceg
added a commit
to nightscout/nocturne
that referenced
this pull request
Nov 11, 2026
…3291) * chore: move to .NET 11 and Aspire 13.6.5, and build without warnings Retargets every project, the CI workflows, base images and docs to .NET 11, bumps Aspire to 13.6.5 and other packages within their current majors, and clears all 455 build warnings. .NET 11 behaviour changes handled: - double-to-decimal casts keep the exact binary value: DecimalConversion.ToDecimal replaces every cast, and decimal factors are decimal constants - Math.Round(double, digits) rounds the exact value: ScaledRounding.Round keeps the scale-round-unscale result Nightscout gives - SignalR evaluates the fallback policy for anonymous hub methods (dotnet/aspnetcore#69683): HasPermissionsHandler passes hub invocations to HubAuthorizationFilter - HttpClient observes cancellation after the handler returns: an unstored Google Health grant is revoked after a repeated account lookup EF Core stays on 10 until Npgsql's provider 11 ships; NSwag stays on 14.6.3, since 14.7 changes the generated client. Co-Authored-By: Claude Fable 5.2 <[email protected]> * fix(deps): pin System.Formats.Cbor past GHSA-vmv3-wvjp-wqpj Fido2 4.3.2 depends on 9.0.0, which projects that reference the API without the ASP.NET Core framework restore. Co-Authored-By: Claude Fable 5.2 <[email protected]> * ci: review fixes for the .NET 11 move - sdk-publish's C# job installs an SDK the repository's global.json accepts - screenshot-regen installs the Aspire CLI the AppHost now takes DCP from - a boxed double in a profile activation's residue converts with ToDecimal Co-Authored-By: Claude Fable 5.2 <[email protected]> * ci: the test solutions hold only the test projects on the .NET 11 SDK dotnet sln add includes project references by default from SDK 11 and fails when two share a file name in one solution folder. Co-Authored-By: Claude Fable 5.2 <[email protected]> * fix(statistics): a local day whose midnight the clock skipped still has bounds From .NET 11 TimeZoneInfo.ConvertTimeToUtc throws for a skipped local time on Linux as it does on Windows, so the punch card, the reports range, the data overview year and alert replay failed for a zone whose clocks go forward at midnight. They convert with TimeZoneHelper.ConvertTimeToUtc, which resolves a skipped time to the first instant after the gap. Co-Authored-By: Claude Fable 5.2 <[email protected]> --------- Co-authored-by: Claude Fable 5.2 <[email protected]>
This branch has not been deployed
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.
Fix SignalR fallback authorization for non-authorization metadata
Prevent non-authorization hub metadata from triggering fallback authorization
Description
SignalR hub method authorization used the presence of any method authorization metadata to determine whether authorization should run.
This caused metadata that does not define an authorization policy, such as
[AllowAnonymous]or an unrelated attribute, to enter the authorization path. WhenAuthorizationPolicy.CombineAsyncfound no applicableIAuthorizeData,AuthorizationPolicy, orIAuthorizationRequirementData, the configured fallback policy was applied instead.With a fallback policy requiring an authenticated user, this caused anonymous hub method invocations to be rejected unexpectedly.
This change ensures that hub method authorization is only performed when the metadata contains authorization-relevant data.
The regression test
AnonymousConnectionCanInvokeMethodsOnAllowAnonymousHubWithFallbackPolicycovers:[AllowAnonymous][AllowAnonymous]The full SignalR test suite was also run successfully after the change.
Note: The standalone reproduction in the issue reports
AsyncNoAttributeas unauthorized on .NET 11 RC1. That specific behavior was not reproduced by the lower-levelHubConnectionHandlerTeststest infrastructure, where a method with no authorization metadata bypasses method authorization. The regression test reproduces the[AllowAnonymous]and unrelated-metadata failures addressed by this change.Fixes #69624
Note
AI assistance was used to help understand the existing test structure and to prepare this pull request description.