Skip to content

Evidence for SHA-1 being a real problem in SSH? #31

@mgkuhn

Description

@mgkuhn

This document has encouraged one of our system administrators to disable any use of SHA-1 in a major SSH server at our site. This has caused compatibility problems, in particular for users of various mobile phone and tablet SSH clients that do not yet support SHA-2.

It would be nice if you could add two things:

a) List which widely used SSH clients are or are not yet compatible with your configuration, to better inform the paranoia-versus-usability trade-off involved.

b) A more detailed discussion of what practical security is actually gained (or not) by disabling SHA-1.

For a) I can note the following:

The Android SSH client ConnectBot version 1.7.1 (the latest version released on Google Play at the time of writing this) only supports the following algorithms:

  • src/com/trilead/ssh2/crypto/digest/MAC.java:
    • "hmac-sha1-96", "hmac-sha1", "hmac-md5-96", "hmac-md5"
  • src/com/trilead/ssh2/transport/KexManager.java:
  • "diffie-hellman-group-exchange-sha1", "diffie-hellman-group14-sha1", "diffie-hellman-group1-sha1"
  • src/com/trilead/ssh2/crypto/cipher/BlockCipherFactory.java:
    • "aes256-ctr", "aes192-ctr", "aes128-ctr", "blowfish-ctr", "aes256-cbc", "aes192-cbc", "aes128-cbc", "blowfish-cbc", "3des-ctr", "3des-cbc"

Therefore, any SHA-2-only configuration will not work with it yet.

Likewise, the iOS ssh client "iSSH - SSH / VNC Console, v5.3.2" by Zinger-Soft appears not compatible.

For b), it would be useful to note the following, to put worries about SHA-1 security into perspective:

The property of SHA-1 that is most suspected is its collision resistance, that is the cost for an adversary to find a pair of messages X != Y such that H(X) = H(Y). Collision resistance is of crucial importance in certificate applications, because lack of collision resistance allows an adversary to present one object X to a certification authority and another object Y to the verifier of the resulting certificate or signature. The lack of collision resistance in MD5 was reportedly abused to sign components of the Flame malware. While similar chosen-prefix collisions have not yet been demonstrated for SHA-1, this is one of several events that has caused a drive to phase out the use of SHA-1 in certificates.

However, if you do not use SSH with certificates, then what risks are there from the ~2^60 collision attacks that have been proposed for SHA-1? Where SHA-1 is used inside the HMAC construction, none of the proposed attacks are applicable, because the attacker knows nothing about the internal state or the output of the inner SHA-1 invocation in HMAC. The HMAC construct provides powerful safeguards around the hash function, by putting it into an unknown state and finally passing its output through a pseudo-random function. Another application of SHA-1 in SSH is as part of the digital signatures that authenticate the exchanged Diffie-Hellman parameters. Again, collision-resistance is not essential here, because a collision can only be abused in applications where a digital signature is verified by at least two different parties (which could be shown different X and Y). Without certificates, the digital signatures generated in the SSH protocol are only ever verified once, by the recipient, and therefore there is nothing useful an adversary could do with a collision they have found. A lack of second-preimage resistance would obviously be of much more concern, but the only proposed attack that I am aware of is the one by Kelsey and Scheier, which still costs 2^106 steps, and which can therefore hardly be described as practical.

No doubt, it is very nice to have SHA-2 (and SHA-3!) widely implemented as fall-back options. But I can not yet see anything in the current research literature that would justify breaking compatibility with widely used SSH clients by disabling SHA-1 today, considering that (without certificates) SSH does not rely on the collision resistance of this secure hash function.

Remember that if you disable a security mechanism, some of your users might chose to circumvent this measure by falling back to some even less secure techniques. In particular, HMAC-SHA-1 is very likely to be far more secure than not using SSH at all, if that is the alternative.

Perhaps the document could be structured such that disabling SHA-1 is left as a step for the future, once it has been more widely implemented on mobile OS SSH clients? After all, hmac-sha2-256 was only defined in July 2012 and has a ridiculously-long digest length of 32 bytes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions