3
$\begingroup$

Looking at RFC4253, I came across the notion that the MAC is applied the encoded packet concatenated with a sequence number which acts as a counter.

However, I couldn't find any information on how that sequence number is validated. What happens if some messages get dropped or corrupted during transit?

Also, when do SSH connections get dropped? As in, decryption failure, MAC verification failure, etc.

$\endgroup$
4
$\begingroup$

However, I couldn't find any information on how that sequence number is validated. What happens if some messages get dropped or corrupted during transit?

SSH, similar to TLS, assumes that it is running over a reliable [1] transport protocol (such as TCP). If something goes wrong (e.g. some message is corrupted or dropped), then the system assumes that the system is under attack, and the connection is dropped.

This is explicitly stated in section 9.3.5 of RFC4251, which states:

This protocol is designed to be used over a reliable transport.  If
transmission errors or message manipulation occur, the connection is
closed.  The connection SHOULD be re-established if this occurs.

[1]: By reliable transport, I (as well as the RFC) mean that it delivers bytes correctly and in order, assuming that the system is not under attack.

$\endgroup$
  • $\begingroup$ Great answer, thanks! However, where does that 'SHOULD be re-established' have its boundaries? Does the session undergo re-keying, re-authentication of parties, or is it simply a 'hiccup'? $\endgroup$ – Daniel B Jun 4 '18 at 11:12
  • 1
    $\begingroup$ @DanielB: they'll have to restart the entire protocol, redoing the authentication. There is no option for doing anything less. $\endgroup$ – poncho Jun 4 '18 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.