ASP.NET Core 9.0
Last reviewed Oct 11, 2026
Prompt Details
Prompt Composition
2prompts
- C# 13112 lines · 4.2K tokens
- ASP.NET Core 9.072 lines · 3.7K tokens
Total184 lines · 7.9K tokens
CWE Coverage
- 20
- 22
- 59
- 73
- 78
- 79
- 89
- 94
- 117
- 190
- 203
- 208
- 209
- 214
- 257
- 295
- 306
- 307
- 312
- 319
- 323
- 327
- 328
- 338
- 347
- 352
- 362
- 367
- 384
- 426
- 434
- 502
- 524
- 525
- 532
- 552
- 601
- 611
- 613
- 614
- 636
- 639
- 759
- 770
- 772
- 798
- 807
- 829
- 862
- 915
- 916
- 918
- 922
- 942
- 1004
- 1275
- 1333
- 1385
- 1395
Prompt Preview
Use these rules for ASP.NET Core 9.0 applications targeting net9.0, after the included C# 13 baseline. Keep the .NET runtime and Microsoft.AspNetCore.App on the current 9.0 servicing release, and migrate before .NET 9 support ends on November 10, 2026. When ASP.NET Core Identity manages accounts, also apply the ASP.NET Core Identity 9.0 prompt for password hashing, lockout, security stamps, and recovery tokens.
Hosting, proxies, and transport
- Put internet-facing deployments behind a hardened reverse proxy, or explicitly configure Kestrel endpoints, certificates, protocols, request timeouts,
MaxRequestBodySize, connection limits, andMaxConcurrentUpgradedConnectionsfor the deployment's abuse budget rather than assuming defaults fit. - Reject untrusted host names: configure top-level
AllowedHostsfor Host Filtering when Kestrel receives requests directly or a proxy preservesHost, and separately constrainForwardedHeadersOptions.AllowedHostswhen processingX-Forwarded-Host. Wildcard Kestrel bindings don't validate theHostheader. - Outside IIS integration, enable
UseForwardedHeadersonly with the exactForwardedHeadersvalues required, a smallForwardLimit, and explicitKnownProxiesorKnownNetworks, before HTTPS redirection, HSTS, authentication, link generation, rate-limit partitioning, and any code using scheme, host, or client IP. - Preserve the ASP.NET Core 9.0.6 hardening that ignores all
X-Forwarded-*values from unknown proxies. Never restore the old behavior by clearing both trust lists, setting