SSPI implementation converts SPN to Lowercase, Causing Authentication Failure with Non-Windows Machines
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- authentication, security
Research direction
Start at SspiSecurityContext.InitializeSecurityContext and trace where the supplied SPN is converted to lowercase. Reproduce the HTTP/myserver case, then verify that the original SPN casing is retained and authentication succeeds against a case-sensitive non-Windows Kerberos server.
Written by the indexing model from the issue text.
Description
Description:
I am using a non-Windows machine with Kerberos protection, where the Service Principal Name (SPN) is case-sensitive. The SPN in my case is HTTP/myserver. However, Kerberos.NET's SspiSecurityContext.InitializeSecurityContext method converts the SPN to lowercase (http/myserver), causing authentication to fail because the server cannot verify the token with the altered SPN.
This behavior breaks compatibility with non-Windows Kerberos implementations, as many UNIX-based systems enforce case sensitivity for SPNs.
Steps to Reproduce:
Set up a Kerberos-protected non-Windows machine with an SPN HTTP/myserver.
Use Kerberos.NET SSPI to authenticate using the SPN HTTP/myserver.
Observe that the SPN is converted to http/myserver, resulting in authentication failure on the server.
Expected Behavior:
The SPN string provided to the SspiSecurityContext.InitializeSecurityContext method should remain in its original case to ensure compatibility with case-sensitive non-Windows servers.
Actual Behavior:
The SPN string is converted to lowercase (http/myserver), leading to token verification failure on the non-Windows server.
Environment:
Kerberos.NET version: [e.g., 4.6.70]
.NET version: [e.g., .NET 8.0]
Operating System: [e.g., Windows 10, Ubuntu 20.04]
Additional Information:
SPNs are case-insensitive on Windows systems but case-sensitive on many non-Windows systems.
Refer to Microsoft documentation for more information:
"Service Principal Names (SPNs) are not case sensitive when used by Microsoft Windows-based computers. However, many UNIX-based systems are case-sensitive and require the proper case to function properly."
A potential fix would be to avoid altering the case of the SPN string in SspiSecurityContext .InitializeSecurityContext.
- Dominant language
- C#
- Stars
- 567
- Forks
- 109
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/Kerberos.NET
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
dotnet/Kerberos.NET#394 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
dotnet/Kerberos.NET#435 · 4 reactions ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 72/100
dotnet/Kerberos.NET#434 · 4 reactions ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 42/100
dotnet/Kerberos.NET#433 ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 66/100
dotnet/Kerberos.NET#428 · 8 comments ·
All issues in dotnet/Kerberos.NET
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·