KB5028166 has caused some disruption in the Samba community, and we are assured that an updated MS-NRPC will be published soon. The new level 2 will document the exact behaviour, but for this to have been rushed out in a security release it will have mattered. (The failure against Samba was clearly not intentional).
Created attachment 17989 [details] WIP patches for master
I like the fact that you check for NT_STATUS_EQUAL(status, NT_STATUS_RPC_BAD_STUB_DATA) and set the result to NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE (is that the same as INVALID?) but as you noted later, the sequence will be out of sync since a patched server will not call dcesrv_netr_creds_server_step_check whereas a not patched will (but is unable to return return_authenticator). Don't know if there is a way to make this compatible with both patched/windows and not patched samba..
(In reply to Michael Saxl from comment #3) It is compatible with patched/unpatched Windows/Samba. notice the state->tmp_creds = *state->creds and *state->creds = state->tmp_creds, which allows us rollback when step function was not called on the server.
(In reply to Michael Saxl from comment #3) NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE is mapped from DCERPC_NCA_S_FAULT_INVALID_TAG
(In reply to Stefan Metzmacher from comment #5) Oh, NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE is wrong, it should be NT_STATUS_RPC_ENUM_VALUE_OUT_OF_RANGE
Comment on attachment 17989 [details] WIP patches for master See https://gitlab.com/samba-team/samba/-/merge_requests/3189 for the latest version of patches
(In reply to Stefan Metzmacher from comment #4) but how do you decide if you rollback? The intended way is to rollback since a patched samba/windows will not step, but samba unpatched will. I'm quite dumb at the specifics but as far as I read you make the step if all succeeds with *state->creds = state->tmp_creds; else a rollback is done. What happens if the server side does the step (as far as I understood the unpatched server will)?
For reference: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-winerrata/69ffd0ac-a0dd-49f2-96ad-6720441b0a93