Repository navigation
anti-CSRF minor clarification about IsOriginAllowed - #37786
Merged
DeagleGross merged 8 commits intoOct 7, 2026
Merged
DeagleGross merged 8 commits into
DeagleGross merged 8 commits into
Conversation
Contributes to dotnet/aspnetcore#69345 - security/anti-request-forgery.md: the automatic CSRF protection middleware's "How it works" and "Allowing cross-origin clients" sections now state that a CORS-allowed origin only grants CSRF trust when the policy also calls .AllowCredentials(). Updated the CORS code sample to include .AllowCredentials() so it stays a correct example, and added a short note next to the existing AllowAnyOrigin warning. - migration/100-to-110/includes/security.md: one-line update to the CORS guidance bullet to mention the new AllowCredentials() requirement. - breaking-changes/11/csrf-cors-allowcredentials-required.md: new breaking-change entry describing the behavior change, following the existing template. Registered in overview.md and toc.yml. Co-authored-by: Copilot App <[email protected]>
Per feedback: the AllowCredentials() requirement for CORS-derived CSRF trust is unreleased (dotnet/aspnetcore#69345 is still open), so it shouldn't be documented as a breaking change or a 10->11 migration concern yet. - Removed breaking-changes/11/csrf-cors-allowcredentials-required.md - Reverted the registration in breaking-changes/11/overview.md and toc.yml - Reverted the migration/100-to-110/includes/security.md CORS bullet - Removed the breaking-change cross-link from anti-request-forgery.md, keeping the AllowCredentials() requirement description, updated CORS code sample, and AllowAnyOrigin note Co-authored-by: Copilot App <[email protected]>
# Conflicts: # aspnetcore/security/anti-request-forgery.md
guardrex
approved these changes
Oct 7, 2026
guardrex
left a comment
Collaborator
There was a problem hiding this comment.
Looks good and will approve now for immediate merge (auto-merge is on), but I mention in passing that this seems to be a bit more of a warning than just a casual note.
Collaborator
|
... and btw ... just noticed that you marked this with the 11.0 label. Was this only for >=11.0? If so, I'll put a patch in to add versioning for it. |
Member
Author
|
Ye, I wanted that to be included in net11 version. that line exists under 11 moniker, so it should be >=11.0 only right? |
Collaborator
|
I see it now! 👀 We're good. Sorry for the trouble. |
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.
Notes the behavior of anti-CSRF around
IsOriginAllowed.Internal previews
Build report