-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UNTRUSTED_SPN_SOURCE should not be set #67
Comments
My goal is to find out what trusted/untrusted really means, and then stop setting untrusted where possible, potentially in all cases if it turns out we should always trust the caller. |
I did some digging and had confirmation that on Windows this flag is controlled by ISC_REQ_UNVERIFIED_TARGET_NAME. When calling SSPI with that ISC set I can also confirm that it sets the untrusted SPN source flag in NTLM. I did some testing with the various permutations and on SMB this is what I found
It seems like having this AV flag set essentially has the server treat any provided SPN from the client as invalid when the policy is set to A guess why this AV flag was added rather than just omitting the Going forward if we wanted to match the behaviour in SSPI then it sounds like we don't want this AV flag set by default and to add a new OID that can be used with |
Sounds to me that SSPI just trusts the client to tell it, and by default trusts the value. The client application seem to have to go out of its way to mark a SPN as untrusted. |
I do not but when asking Steve the same question he stated
I didn't really go further into what those conditions may be or what components may do it. Ultimately I think gssntlmssp as you said should not have it set and provide a mechanism (some time in the future) where a caller could mark it as untrusted. I don't see any way that this library can determine the trustworthiness of the value. |
@jborean93 can you check if #68 makes things work again? |
Can confirm it works. |
(Continuing from jborean93/smbprotocol#169)
Windows servers have a security policy Microsoft network server: Server SPN target name validation level, which (if enabled) will check the SPN sent in MSV_AV_TARGET_NAME and will reject authentication if it thinks you're authenticating to an unrecognized SPN. (I assume this is meant to prevent NTLM relay attacks, though it also adds checks to Kerberos SPNs as well.)
Latest gss-ntlmssp Git now sends the SPN in the correct format, but still gets rejected by Windows servers with this policy enabled. The biggest difference I can see between gss-ntlmssp and working clients (Win10, Samba, pyspnego) is that gss-ntlmssp now sets the
UNTRUSTED_SPN_SOURCE
flag in MSV_AV_FLAGS, which none of the other clients do, and if I understand the NTLM spec right this flag tells the server to pretend the SPN field was empty (which the newly added checks then reject as unrecognized).The text was updated successfully, but these errors were encountered: