3 ms·
> I'm actually surprised the ssh protocol doesn't have MITM mitigation built in. Part of the original U2f Spec was that the TLS session State could be hashed an
by agwa 5y ago
> I'm actually surprised the ssh protocol doesn't have MITM mitigation built in. Part of the original U2f Spec was that the TLS session State could be hashed and included as part of the client signature, effectively making MITM impossible.
When you use SSH public key authentication, a hash of the key exchange (called the "session identifier") is included in the client signature, much like the U2F channel binding you describe: https://datatracker.ietf.org/doc/html/rfc4252#section-7 https://datatracker.ietf.org/doc/html/rfc4252#section-7
This provides the same amount of protection as the U2F channel binding: namely, the MitM is unable to forward the signature to the server and successfully authenticate to the server as the client.
However, neither SSH nor U2F channel binding prevents the MitM from impersonating the server and hoping the client transmits something confidential. The SSH-MITM tool supports redirecting clients to a honeypot for this purpose.
Additionally, if the SSH client has agent forwarding enabled, the MitM can just ask the client to sign a new signature in order to authenticate to the server. The SSH-MITM tool also supports this.
Bottom line, no amount of channel binding in the authentication protocol is a substitute for correctly validating the server's identity, especially if you have SSH agent forwarding enabled.
- genewitch 5y agoOh, the server fingerprint I have ignored literally tens of thousands of times in my life? I don't turn it off, because I like the warning, but dhcp has made me completely blind to server keys.
- GoblinSlayer 5y agoIf you connect by constant server name, dhcp shouldn't invalidate TOFU.
- not-elite 5y agoYou can search `known_hosts` for a fingerprint using `ssh-keygen -l -f ~/.ssh/known_hosts` and `grep`. If you disable `HashKnownHosts` in your ssh config, the command will also tell you the name of the host(s) for that fingerprint, rather than its hash. I use this all the time, because my AWS/Azure/GCP ips change constantly, but their pubkey fingerprints do not. [1] https://www.schneier.com/blog/archives/2005/05/the_potential_f.html https://www.schneier.com/blog/archives/2005/05/the_potential...