skip to content

What does SMB 3.1.1 pre-authentication integrity protect, and which downgrade does it still leave open?

level: seniorimportance: nice to knowfreq 12%

answer

  1. a hash of what was said earlier
  2. SHA-512 is the only defined hash
  3. key derivation takes the hash as input
  4. stops SMB 2.x downgrade, not SMB 1.0
  5. event 1005 on the server

basics

~20 s

SMB 3.1.1 hashes the NEGOTIATE and SESSION_SETUP exchange with SHA-512 and feeds the result into key derivation, so tampering breaks the keys and the connection drops. It does not prevent a downgrade to SMB 1.0.

solid answer

~40 s

In SMB 3.1.1 each side keeps a running SHA-512 hash over the NEGOTIATE request and response and the SESSION_SETUP messages, and derives its session keys, including the signing key, from that hash. If an on-path party altered what either side saw, the two derive different keys, signature or decryption checks fail and the connection is dropped; Microsoft says event 1005 is then logged in `Microsoft-Windows-SmbServer/Operational`. It replaced the older secure dialect negotiation of 3.0 and 3.0.2. It stops a downgrade to SMB 2.x but, per Microsoft, not one to SMB 1.0, so the SMB 1.0 server still has to be disabled. Guest and anonymous sessions derive no keys, so they get no protection from it.

go deeper

for a junior

Recall that SMB 3.1.1 hashes the negotiation with SHA-512 so a tampered offer breaks the session keys.

for a middle

Describe what is hashed (NEGOTIATE and SESSION_SETUP), what consumes the hash (key derivation), and the event logged on detection (1005).

for a senior

State the limit correctly, no protection against a downgrade to SMB 1.0, and turn it into the control: disable the SMB 1.0 server after auditing.

for a principal

Explain why a mandatory protocol feature still needs an estate-level decision about the weakest dialect left reachable.

## What gets hashed Pre-authentication integrity is **mandatory in SMB 3.1.1**. It is announced in the NEGOTIATE request by the negotiate context of type `0x0001`, which lists hash algorithms (the only one MS-SMB2 defines is `0x0001`, SHA-512) and an optional **salt**. Both sides then keep a running value: 1. Start at zero. 2. Hash that value concatenated with the NEGOTIATE request, and keep the result. 3. Hash that value concatenated with the NEGOTIATE response, and keep the result. 4. Continue the same way with each SESSION_SETUP request and response, up to the last request of the authentication. Microsoft's blog describing the feature gives the same recurrence: each hash covers the previous hash plus the next message, starting from zeros. The final value becomes the **context** input of the key derivation for the session keys, instead of a fixed string, which is what MS-SMB2 does for earlier dialects. ## A worked sequence 1. The client sends NEGOTIATE with the pre-authentication integrity context: SHA-512 and a salt. Both sides hash that request into a running value that started at zero. 2. The server answers with its NEGOTIATE response, which both sides fold into the running value. 3. The client sends SESSION_SETUP, and the server answers; for a multi-leg authentication this repeats, and each message is hashed in turn. 4. When authentication completes, each side derives the session's keys, with the running value as the derivation context. 5. The last SESSION_SETUP response is signed, and the client signs or encrypts its TREE_CONNECT. If the two running values differ, the first of these checks fails. ## Why a changed message breaks the connection If an on-path party altered the offer one side saw, the two sides hold different hash values, derive different keys, and cannot validate each other's signature or decrypt each other's messages. Microsoft's blog adds two details: the final SESSION_SETUP response is always signed, so the client fails signature validation if the earlier messages were tampered with; and the client must sign or encrypt the TREE_CONNECT request, which confirms to the server that both derived the same keys. Microsoft's SMB security page says the connection is disconnected and **event 1005** is logged in `Microsoft-Windows-SmbServer/Operational`. ## What it replaced **Secure dialect negotiation** is the mechanism of SMB 3.0 and 3.0.2. After the tree connect the client repeats its NEGOTIATE inside a signed `FSCTL_VALIDATE_NEGOTIATE_INFO` request and the server answers in a signed response, so the check happens only after session setup. Microsoft's blog says pre-authentication integrity supersedes it, and MS-SMB2 agrees: a client validates this way only when the dialect is not 3.1.1, and a server that receives `FSCTL_VALIDATE_NEGOTIATE_INFO` on a 3.1.1 connection terminates it. Microsoft's feature table still shows a tick for secure dialect negotiation in the 3.1.1 column; follow the specification and the blog here, which treat it as 3.0 and 3.0.2 only. ## What it does not do | Limit | Why | |---|---| | Does not stop a downgrade to SMB 1.0 | Microsoft's SMB security page says it prevents a downgrade to SMB 2.x but not to SMB 1.0; SMBv1 sessions have no such hash | | Does not protect guest or anonymous sessions | the blog says no keys can be derived for them, so nothing proves the hashed messages | | Does not conceal anything | the hash detects alteration of the messages; it does not hide them | | Is not a setting | it is mandatory in 3.1.1, so there is nothing to switch on and no audit mode for it | That first row is the administrator's decision point. A 3.1.1 estate that still has an SMB 1.0 server running has a path that pre-authentication integrity cannot cover, so the control is to disable the SMB 1.0 server, which Microsoft says to do on that page. ## What you would say in a review - Which dialects are in use: read the second NEGOTIATE response in a capture, or `Get-SmbSession` on the server. - Whether anything is still on SMB 1.0: the audit trail from `AuditSmb1Access`, event 3000. - Whether tampering has been detected: event 1005 in `Microsoft-Windows-SmbServer/Operational`. - Whether to raise the dialect floor to 3.1.1 so every session gets the hash: a separate decision with its own cost.

  • Why does Microsoft tell you to disable the SMB 1.0 server even on a 3.1.1 estate?
    Because pre-authentication integrity stops a downgrade to SMB 2.x but not to SMB 1.0, which Microsoft's SMB security page says would also result in unencrypted access. Disabling the SMB 1.0 server removes the downgrade target; auditing with AuditSmb1Access first shows whether anything still needs it.
  • A security review asks whether tampering with SMB 3.1.1 negotiation is detected. What evidence do you point to?
    The feature is mandatory in SMB 3.1.1, so it is not a setting to audit. Evidence of an actual detection is event 1005 in Microsoft-Windows-SmbServer/Operational. Absence of that event on a 3.1.1 connection is expected.
  • How does 3.0's secure dialect negotiation differ in timing from pre-authentication integrity?
    It runs after the tree connect, as a signed FSCTL_VALIDATE_NEGOTIATE_INFO exchange that repeats the NEGOTIATE, so the earlier messages were unprotected until then. Pre-authentication integrity hashes the NEGOTIATE and SESSION_SETUP messages into key derivation itself.

Both parties sign a record of everything said while introducing themselves, so a changed introduction shows up at the first signature. It protects nothing for someone who never signs, and it cannot stop a meeting that happens on the unsigned, older terms.

  • Pre-authentication integrity prevents every downgrade including SMB 1.0
  • It encrypts the NEGOTIATE exchange so nobody can read the offer
  • A 3.1.1 server still answers FSCTL_VALIDATE_NEGOTIATE_INFO
  • Guest sessions are covered because the hash is always computed
  • It is a policy setting you must switch on