Dealing with the 'OpenSSH MaxAuthTries Bypass' vulnerability in ESXi 5.5

System: VMware ESXi 5.5

- last updated on -

About: The purpose of this document is to present a functional workaround in resolving the OpenSSH MaxAuthTries Bypass/CVE-2015-5600 vulnerability in ESXi 5.5, since the vendor is unlikely to release a fix in the near future (note that these lines were written about 2 years back), since it consists of upgrading OpenSSH to version 7.0 (according to the package's own release notes), but the software packages that are bundled with an ESXi release tend to be pretty static - in this case, ESXi 5.5 U3c (the version that was current at the time of this having been written initially) contains version 5.6p1 of OpenSSH.

Workaround: The fix consists of a modification that needs to be done to the SSH daemon's configuration file, the /etc/ssh/sshd_config, namely of disabling OpenSSH's modern keyboard-interactive authentication method, which allows the use of various types of authentication methods that utilize a keyboard as a means of proving identity, such as one-time passwords or a PIN that is generated based on a server challenge, and instead enabling the legacy password method, which only accepts a static 'username/password' pair for the same purpose. Of course, if you are using the publickey authentication method then the point is moot and you are better off disabling the keyboard/password authentication altogether.

Working instructions:

debug1: Authentications that can continue: publickey,keyboard-interactive

debug1: Authentications that can continue: publickey,password

For the sake of having a reference, below you will find two examples of the sshd_config file, one in its vanilla state (should have been previously untouched), and one modified as per the instructions found here:

the vanilla 'sshd_config'
# running from inetd
# Port 2200
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key

UsePrivilegeSeparation no

SyslogFacility auth
LogLevel info

PermitRootLogin yes

PrintMotd yes
PrintLastLog no

TCPKeepAlive yes

X11Forwarding no

Ciphers aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc

MACs hmac-sha1,hmac-sha1-96

UsePAM yes
# only use PAM challenge-response (keyboard-interactive)
PasswordAuthentication no

Banner /etc/issue

Subsystem sftp /usr/lib/vmware/openssh/bin/sftp-server -f LOCAL5 -l INFO

AuthorizedKeysFile /etc/ssh/keys-%u/authorized_keys

# Timeout value of 10 mins. The default value of ClientAliveCountMax is 3. 
# Hence, we get a  3 * 200 = 600 seconds timeout if the client has been
# unresponsive.
ClientAliveInterval 200

# sshd(8) will refuse connection attempts with a probability of "rate/100"
# (30%) if there are currently "start" (10) unauthenticated connections.  The
# probability increases linearly and all connection attempts are refused if the
# number of unauthenticated connections reaches "full" (100)
MaxStartups 10:30:100

the modified 'sshd_config'
# running from inetd
# Port 2200
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key

UsePrivilegeSeparation no

SyslogFacility auth
LogLevel info

PermitRootLogin yes

PrintMotd yes
PrintLastLog no

TCPKeepAlive yes

X11Forwarding no

Ciphers aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc

MACs hmac-sha1,hmac-sha1-96

UsePAM yes
# only use PAM challenge-response (keyboard-interactive) -- this has been changed, see below

###An attempt to work around the 'OpenSSH MaxAuthTries Bypass' vulnerability -- 19.05.2016 -- IT
## will be implemented by doing the following:
# 1. explicitly entering the 'ChallengeResponseAuthentication' directive and setting it to 'no' (OpenSSH implicitly defaults it to 'yes')
# 2. modifying the 'PasswordAuthentication' directive, by setting it to 'yes' (normally comes defined as 'no')
ChallengeResponseAuthentication no
PasswordAuthentication yes
### end of workaround - to revert, remove everything in this paragraph (quotes included, as they will no longer serve a purpose), with the exception of 'PasswordAuthentication', which should be changed to 'no'

Banner /etc/issue

Subsystem sftp /usr/lib/vmware/openssh/bin/sftp-server -f LOCAL5 -l INFO

AuthorizedKeysFile /etc/ssh/keys-%u/authorized_keys

# Timeout value of 10 mins. The default value of ClientAliveCountMax is 3. 
# Hence, we get a  3 * 200 = 600 seconds timeout if the client has been
# unresponsive.
ClientAliveInterval 200

# sshd(8) will refuse connection attempts with a probability of "rate/100"
# (30%) if there are currently "start" (10) unauthenticated connections.  The
# probability increases linearly and all connection attempts are refused if the
# number of unauthenticated connections reaches "full" (100)
MaxStartups 10:30:100

#Disable the (enabled by default) UseDNS directive, as it serves no purpose (in our particular infrastructure) and only serves to delay the SSH login to the host - 13.04.2016 - IT
UseDNS no