Repository navigation
ntlm: check the NTProofStr in NTLMSSP._getSessionBaseKey - #5303
Open
musthaf-bughunter wants to merge 1 commit into
Open
musthaf-bughunter wants to merge 1 commit into
musthaf-bughunter wants to merge 1 commit into
Conversation
_getSessionBaseKey derived the session key from the client NTProofStr without checking it, relying on _checkLogin. NTLMSSP_DOMAIN overrides _checkLogin to return True and falls back to the parent _getSessionBaseKey for local IDENTITIES, so any password was accepted for those users. Check the NTProofStr where the key is derived. AI-Assisted: yes (Claude Opus 5.5)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5303 +/- ##
==========================================
+ Coverage 80.65% 80.68% +0.02%
==========================================
Files 375 375
Lines 98785 98789 +4
==========================================
+ Hits 79679 79707 +28
+ Misses 19106 19082 -24
🚀 New features to boost your workflow:
|
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.
Description
NTLMSSP._getSessionBaseKeyderives the session key from the client'sNTProofStrwithout checking it (ntlm.py#L2146-L2156); the check only happens later in_checkLogin.NTLMSSP_DOMAIN._checkLoginalways returnsTrue(#L2380-L2382), butNTLMSSP_DOMAIN._getSessionBaseKeyfalls back to the parent for localIDENTITIESwhen the AUTHENTICATE message has noDomainName(#L2279-L2281) or when Netlogon fails. AnNTLMSSP_DOMAINacceptor configured withIDENTITIEStherefore accepts any password for those users.Repro (client sends an empty
DomainNameand no MIC):The
NTProofStris now checked in_getSessionBaseKey, and a mismatch returnsNone, which the caller already handles as "Bad NTProofStr or unknown user" (#L1993-L1996). For plainNTLMSSP, a wrong password now returnsGSS_S_DEFECTIVE_CREDENTIALinstead of falling through and returningNone. A test for both SSPs is added tontlm.uts.