Repository navigation
Conversation
Restrict GSSAPI acceptor credentials to the requested Kerberos or NTLM mechanism and reject completed contexts using another protocol. Preserve Negotiate fallback and add package restriction regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 4 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones |
This branch has not been deployed
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.
Summary
Unix
NegotiateAuthenticationservers using default credentials currently acquire GSSAPI acceptor credentials for all mechanisms, regardless ofNegotiateAuthenticationServerOptions.Package. Consequently, a server requestingKerberoscan accept NTLM, and a server requestingNTLMcan accept Kerberos. Windows already restricts the server to the explicitly selected package.Negotiatebehavior, including NTLM fallback, and document the explicit-package restriction.Related discussion: #136154 (comment)
Compatibility
This intentionally changes Unix server behavior to match Windows: applications that previously relied on an explicit package accepting another mechanism must use
Negotiateinstead. Explicit mechanism credentials also reject SPNEGO-wrapped tokens; clients should select the server's explicit package, or the server should useNegotiate. Client package selection is unchanged.Validation
Linux validation used an isolated WSL Ubuntu 25.10 checkout with the same source changes. Windows validation used a short
substpath to avoid path-length failures.R:\build.cmd clr+libs -rc release— passed..\.dotnet\dotnet.exe build src\libraries\System.Net.Security\tests\UnitTests\System.Net.Security.Unit.Tests.csproj /t:Test /p:RuntimeConfiguration=Release /p:XunitClassName=System.Net.Security.Tests.NegotiateAuthenticationTests— 28 total, 0 failed, 4 skipped../build.sh clr+libs -rc releaseand./build.sh libs -rc release— passed.dotnet build src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj /t:Test /p:RuntimeConfiguration=Release /p:XunitClassName=System.Net.Security.Tests.NegotiateAuthenticationKerberosTest— before the fix, all four wrong-package cases failed because NTLM returnedContinueNeededor Kerberos returnedCompleted; after the fix, all 15 cases passed without skips.dotnet build src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj /t:Test /p:RuntimeConfiguration=Release— 5,143 total, 0 failed, 8 skipped.dotnet build src/libraries/System.Net.Security/tests/UnitTests/System.Net.Security.Unit.Tests.csproj /t:Test /p:RuntimeConfiguration=Release— 138 total, 1 failed, 12 skipped. The existingPackage_Unsupported_NTLMtest expectsUnsupportedbut receivesContinueNeededbecause its availability predicate excludes OpenSSL 3 and does not enable managed NTLM on Ubuntu 25.10. Reverting the product fix and rebuilding reproduced the identical failure and counts.git diff --check— passed.macOS was not exercised. The Kerberos functional class is unsupported on Windows; it was not counted as Windows execution coverage.
Note
This pull request and its description were created with GitHub Copilot.