Skip to content

Merge to Live#37256

Merged
wadepickett merged 1 commit into
livefrom
main
Jun 15, 2026
Merged

Merge to Live#37256
wadepickett merged 1 commit into
livefrom
main

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

[AUTOMATED]

* 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>
@wadepickett wadepickett self-requested a review June 15, 2026 20:13
@wadepickett wadepickett self-assigned this Jun 15, 2026

@wadepickett wadepickett left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@wadepickett wadepickett merged commit 46cbcfe into live Jun 15, 2026
4 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