In my company we have a SharePoint server and an Active Directory domain. If I want to get any information from the SharePoint server, I have to send over some credentials like this:
var request = (HttpWebRequest)WebRequest.Create(uri);
request.Method = "GET";
request.Credentials = CredentialCache.DefaultNetworkCredentials; // <-- credentials
var response = request.GetResponse();
This works fine and is no problem because I trust the SharePoint server.
But I was wondering: Is it a security problem to send DefaultNetworkCredentials
to an untrusted server? Can an untrusted server use these credentials to impersonate me/the user? Can it extract my password from these credentials?
I'm guessing/hoping these credentials don't just contain the (plain-text) Windows password. However, the MSDN documentation for DefaultNetworkCredentials
states:
The credentials returned by DefaultNetworkCredentials represents the authentication credentials for the current security context in which the application is running. For a client-side application, these are usually the Windows credentials (user name, password, and domain) of the user running the application.
There's also this remark (in the same MSDN document):
The credentials returned by the DefaultNetworkCredentials property is applicable only for NTLM, negotiate, and Kerberos-based authentication.
I'm guessing that means that DefaultNetworkCredentials
is safe to use - but I like to have some confirmation on that; because I don't know what "NTLM, negotiate, and Kerberos-based authentication" really means - except that they're (probably) some kind of authentication mechanism.