ASP.NET Core 8.0
Last reviewed Sep 6, 2026
Prompt Details
Prompt Composition
2prompts
- C# 12124 lines · 4.2K tokens
- ASP.NET Core 8.063 lines · 3K tokens
Total187 lines · 7.2K tokens
CWE Coverage
- 20
- 22
- 59
- 73
- 78
- 79
- 89
- 94
- 117
- 190
- 208
- 209
- 214
- 257
- 295
- 312
- 319
- 323
- 327
- 338
- 347
- 352
- 362
- 367
- 378
- 426
- 434
- 488
- 502
- 524
- 525
- 532
- 552
- 601
- 613
- 614
- 636
- 639
- 674
- 759
- 770
- 772
- 775
- 798
- 807
- 862
- 915
- 916
- 918
- 942
- 1004
- 1275
- 1333
- 1395
Prompt Preview
Apply the C# 12 baseline first. These rules cover ASP.NET Core 8.0 hosting, middleware, endpoints, model binding, authentication, authorization, antiforgery, data protection, errors, and deployment. When ASP.NET Core Identity manages accounts, also apply the ASP.NET Core Identity 8.0 prompt for password hashing, lockout, security stamps, and recovery tokens.
Hosting and proxy boundaries
- Configure
ForwardedHeadersOptions.ForwardedHeadersexplicitly; its default isNone,ForwardLimitis1, and only loopback is trusted by default, so list trusted peers inKnownProxiesorKnownNetworksand never accept forwarding headers from arbitrary peers. - Do not set
ForwardLimit = nullunlessKnownProxiesorKnownNetworksstill bounds the chain; discard client-suppliedX-Forwarded-*values at the trusted edge before ASP.NET Core consumes them. Do not clear both trust lists or rely onASPNETCORE_FORWARDEDHEADERS_ENABLED=truewithout restoring them. Never enableMicrosoft.AspNetCore.HttpOverrides.IgnoreUnknownProxiesWithoutForthroughruntimeconfig.json(including aRuntimeHostConfigurationOptionin the project file),AppContext.SetSwitch, or theMICROSOFT_ASPNETCORE_HTTPOVERRIDES_IGNORE_UNKNOWN_PROXIES_WITHOUT_FORenvironment variable; whenXForwardedForisn't processed, that switch makes the middleware accept the other forwarded headers from any peer. Check container, host, and platform environment settings for that variable. - Set host-filtering
AllowedHostsforHostandForwardedHeadersOptions.AllowedHostsforX-Forwarded-Hostto