/ openssh-portable Public
CVE-2020-14871 remote attack mitigation #212
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge.
CVE-2020-14871 in Solaris is a buffer-overflow vuln in PAM. Oracle's SSH and OpenSSH pass the username as-is to the Solaris PAM, and can trigger a remote exploit as there is insufficient bounds checking in PAM.
While patches are available for Solaris 10 and Solaris 11, for those circumstances where an organisation is not entitled to Oracle Premier Support, mitigation in SSHD would help reduce the likelihood of a remote exploit, whilst acknowledging that the PAM module is still broken, and local exploits may still be possible.
Setting MAXUSERLEN to zero in the updated auth2.c results in default OpenSSH sshd behaviour, but setting it to a nonzero value will truncate any long usernames to the length specified. The Solaris PAM issue is with a 512 byte buffer, so any value of MAXUSERLEN less than 512 should prevent sshd from passing a string capable of breaking PAM.