-
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
Lack of NTLMSSP_NEGOTIATE_VERSION and offset calculation #62
Comments
I cross-checked with some other open source implementations:
There's a chance that the official specification is incorrect so more testing is necessary. However, setting |
Tested against Windows Server 2022 and it confirms that the official specification is correct and the MIC offset is fixed regardless of
The server unilaterally sends the |
I recommend evaluating this with extra scrutiny. So far every non-Windows implementation of NTLM (gss-ntlmssp, Apple, Heimdal, MailKit, FreeRDP, Wireshark analyzer) that I tested so far was not matching specification. That said, some of the implementations share heritage (Heimdal & Apple) and others could have simply copied the bug when the official specification was not available. Most of the implementation also never run into the code path for various reasons (eg. Apple always negotiates |
I think you are actually right, in the MS-NLMP document, which this implementation is based on, and I maintain is the most correct independent implementation, it says always:
I mistakenly assumed this meant the structure would be omitted when the flag was not present, but that is not the case, the language just says "populated", which means the structure should alays be present but zeroed when the version is not requested. |
The code seems to assume that the MIC offset is shifted down 8 bytes if
NTLMSSP_NEGOTIATE_VERSION
flag is not present. That doesn't seem to be in line with the Microsoft specification which always lists it as present, just being set to zero bytes. This discrepancy causes the MIC to be placed at a wrong offset and thus inadverently fail the integrity check.I discovered it when comparing the macOS, Windows and this implementation. The MIC generation was explicitly enabled for the test through the private SPNEGO inquiry (https://github.com/dotnet/runtime/pull/65627/files#diff-c67e0117ce4bb818f2a2cc2c01ea9b2058c1a63b846af571ed2d59a2db9d33ffR411)
The text was updated successfully, but these errors were encountered: