HttpSys: fail startup when Strict hardening cannot be applied - #67720
Merged
DeagleGross merged 1 commit intoJul 13, 2026
Merged
Conversation
When HttpAuthenticationHardeningLevel.Strict is configured, the caller is asking for a hard security guarantee (reject authenticated requests that lack a valid channel binding token). Silently degrading to the OS default hardening on a SetProperty failure is misleading, so throw and fail startup instead. Legacy/Medium continue to log-and-continue via SetUrlPropertyError. Follow-up to dotnet#67436 addressing dotnet#67436 (comment). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
DeagleGross
force-pushed
the
dmkorolev/httpsys-strict-hardening-throw
branch
from
July 10, 2026 07:36
0a7be4b to
8dcbab7
Compare
DeagleGross
enabled auto-merge (squash)
July 10, 2026 07:36
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens HttpSys startup behavior when HttpAuthenticationHardeningLevel.Strict is configured by ensuring the server fails fast if the underlying HttpServerChannelBindProperty cannot be applied, avoiding a misleading “best effort” security configuration in a strict mode.
Changes:
- Make
UrlGroup.SetChannelBindingPropertythrow onHttpSetUrlGroupPropertyfailures when hardening level isStrict. - Keep existing log-and-continue behavior for
LegacyandMedium. - Add inline rationale documenting why
Strictis treated as a hard requirement.
Show a summary per file
| File | Description |
|---|---|
| src/Servers/HttpSys/src/NativeInterop/UrlGroup.cs | Changes SetChannelBindingProperty to fail startup on property-apply failures when Strict is configured. |
Copilot's findings
Comments suppressed due to low confidence (1)
src/Servers/HttpSys/src/NativeInterop/UrlGroup.cs:53
- The new comment says this path is "silently degrading" on failure, but
SetPropertylogs an error even whenthrowOnErroris false. Consider rewording to avoid implying the failure is silent and to state explicitly that the OS default hardening remains in effect when the property can't be applied.
internal unsafe void SetChannelBindingProperty(HttpAuthenticationHardeningLevel level)
{
var info = new HTTP_CHANNEL_BIND_INFO
{
- Files reviewed: 1/1 changed files
- Comments generated: 0
halter73
approved these changes
Jul 13, 2026
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.
Follow-up to #67436 addressing #67436 (comment).
When
HttpAuthenticationHardeningLevel.Strictis configured, the caller is asking for a hard security guarantee (reject authenticated requests that lack a valid channel binding token). Silently degrading to the OS default hardening on aSetPropertyfailure is misleading, so throw and fail startup instead.Legacy/Mediumcontinue to log-and-continue viaLog.SetUrlPropertyError, matching the previous behavior.Change
UrlGroup.SetChannelBindingPropertynow callsSetProperty(..., throwOnError: level == HttpAuthenticationHardeningLevel.Strict).Notes
HttpServerChannelBindPropertyis Windows 7 / Server 2008 R2, so failure on a supported OS realistically only happens under kernel policy/ACL restrictions or test shims.Mediumlevel.