Skip to content

CVE-2020-14871 remote attack mitigation #212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

minceheid
Copy link

@minceheid minceheid commented Nov 8, 2020

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.

@daztucker
Copy link
Contributor

Thanks. I committed a variant of this in fcf429a.
Damien found the offending PAM code (https://github.com/joyent/illumos-joyent/blob/edd669a7ce20a2f7406e8f00489c426c0690f1bd/usr/src/lib/libpam/pam_framework.c#L622) and the size of the buffer in question is exposed in the PAM header, so we always enable the mitigation for Sun-derived PAM stacks with the limit specified in the PAM header, terminate (and log) the connection if found, and with the code in auth-pam.c with the rest of the PAM code.

@daztucker daztucker closed this Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants