Skip to content

HttpSys: fail startup when Strict hardening cannot be applied - #67720

Merged
DeagleGross merged 1 commit into
dotnet:mainfrom
DeagleGross:dmkorolev/httpsys-strict-hardening-throw
Jul 13, 2026
Merged

HttpSys: fail startup when Strict hardening cannot be applied#67720
DeagleGross merged 1 commit into
dotnet:mainfrom
DeagleGross:dmkorolev/httpsys-strict-hardening-throw

Conversation

@DeagleGross

@DeagleGross DeagleGross commented Jul 10, 2026

Copy link
Copy Markdown
Member

Follow-up to #67436 addressing #67436 (comment).

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 Log.SetUrlPropertyError, matching the previous behavior.

Change

UrlGroup.SetChannelBindingProperty now calls SetProperty(..., throwOnError: level == HttpAuthenticationHardeningLevel.Strict).

Notes

  • The OS floor for HttpServerChannelBindProperty is Windows 7 / Server 2008 R2, so failure on a supported OS realistically only happens under kernel policy/ACL restrictions or test shims.
  • No behavior change for the default Medium level.

@DeagleGross
DeagleGross requested a review from halter73 as a code owner July 10, 2026 07:34
Copilot AI review requested due to automatic review settings July 10, 2026 07:34
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
DeagleGross force-pushed the dmkorolev/httpsys-strict-hardening-throw branch from 0a7be4b to 8dcbab7 Compare July 10, 2026 07:36
@DeagleGross
DeagleGross enabled auto-merge (squash) July 10, 2026 07:36

Copilot AI 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.

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.SetChannelBindingProperty throw on HttpSetUrlGroupProperty failures when hardening level is Strict.
  • Keep existing log-and-continue behavior for Legacy and Medium.
  • Add inline rationale documenting why Strict is 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 SetProperty logs an error even when throwOnError is 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

@DeagleGross
DeagleGross merged commit 19a1265 into dotnet:main Jul 13, 2026
25 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 14, 2026
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.

3 participants