Merge to Live#37256
Merged
Merged
Conversation
* Add reference doc for automatic CSRF protection in .NET 11 Introduces aspnetcore/security/csrf-protection.md covering the new auto-injected CsrfProtectionMiddleware that ships in .NET 11. Documents: * Decision flow (Sec-Fetch-Site / Origin / CORS / non-browser fallback) * Why the headers can be trusted (forbidden request headers) * Default behavior and integration with .DisableAntiforgery() / [IgnoreAntiforgeryToken] * Allowing cross-origin clients through resolved CORS policy * Per-endpoint opt-out and global DisableCsrfProtection escape hatch * ICsrfProtection customization, browser support, troubleshooting * Adopting CSRF-only protection in apps currently on the token-based system Follow-up commits in this PR will add a migration article (xref:migration/antiforgery-to-csrf), a callout in the existing anti-request-forgery doc, the .NET 11 release-notes include, and toc.yml entries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add migration guide: Adopt automatic CSRF protection in .NET 11 Adds aspnetcore/migration/antiforgery-to-csrf.md as a standalone article that leads with the positive recommendation (modern apps can drop the token-based system in favor of the automatic CSRF middleware) and includes an upgrade-troubleshooting section for the cross-origin 400 case. Also trims the duplicate 'Adopting CSRF-only protection' section in csrf-protection.md to a one-line pointer, and links the new article from Additional resources. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove Blazor SSR carve-outs from migration article Blazor SSR's antiforgery dependency is likely to change, so don't mention it as a reason to keep the token-based system. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix API name, table header, and tighten phrasing - antiforgery-to-csrf.md: replace fictional .RequireAntiforgeryToken() extension with the real RequireAntiforgeryTokenAttribute. Drop the reference to scripts from the IAntiforgery sentence (it's server-side). Soften "most apps that are upgrading have UseAntiforgery()" to "most apps that use the token-based system have UseAntiforgery()". - csrf-protection.md: add "Aspect" header to the first column of the Interaction-with-token-based-antiforgery comparison table. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add TOC entries for CSRF protection docs - Security: "Automatic CSRF protection" after the existing antiforgery entry, pointing to security/csrf-protection. - Migration and updates: "Adopt automatic CSRF protection in .NET 11" right after Overview, pointing to migration/antiforgery-to-csrf. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update aspnetcore/security/csrf-protection.md Co-authored-by: Wade Pickett <wpickett@microsoft.com> * Update aspnetcore/security/csrf-protection.md Co-authored-by: Wade Pickett <wpickett@microsoft.com> * Update aspnetcore/security/csrf-protection.md Co-authored-by: Wade Pickett <wpickett@microsoft.com> * Update aspnetcore/security/csrf-protection.md Co-authored-by: Wade Pickett <wpickett@microsoft.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Wade Pickett <wpickett@microsoft.com>
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.
[AUTOMATED]