Bug 1364935 (CVE-2016-6515)

Summary: CVE-2016-6515 openssh: Denial of service via very long passwords
Product: [Other] Security Response Reporter: Andrej Nemec <anemec>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: cobrown, dengguoqiang, jjelen, mattias.ellert, plautrba, redhat, tmraz
Target Milestone: ---Keywords: Reopened, Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: openssh 7.3 Doc Type: If docs needed, set a value
Doc Text:
It was found that OpenSSH did not limit password lengths for password authentication. A remote unauthenticated attacker could use this flaw to temporarily trigger high CPU consumption in sshd by sending long passwords.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-08 02:57:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1364936, 1446514, 1794510    
Bug Blocks: 1364938, 1415638    

Description Andrej Nemec 2016-08-08 09:08:10 UTC
A denial of service vulnerability was found in openssh. The auth_password function in auth-passwd.c in sshd in OpenSSH before 7.3 does not limit password lengths for password authentication, which allows remote attackers to cause a denial of service (crypt CPU consumption) via a long string.

References:

http://seclists.org/oss-sec/2016/q3/215

Upstream fix:

https://github.com/openssh/openssh-portable/commit/fcd135c9df440bcd2d5870405ad3311743d78d97

Comment 1 Andrej Nemec 2016-08-08 09:08:35 UTC
Created openssh tracking bugs for this issue:

Affects: fedora-all [bug 1364936]

Comment 7 errata-xmlrpc 2017-08-01 18:45:18 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2017:2029 https://access.redhat.com/errata/RHSA-2017:2029

Comment 8 Adrian Brzezinski 2019-04-26 09:58:32 UTC
(In reply to Dhiru Kholia from comment #5)
> Statement:
> 
> This issue in OpenSSH is mitigated by the usage of SELinux in Red Hat
> Enterprise Linux 6 and Red Hat Enterprise Linux 7.

Can you elaborate on this? My tests dosen't seem to support that claim for RHEL6 with default policies.

Comment 9 Tomas Mraz 2019-04-26 11:06:32 UTC
What do your tests show? The CVE was based on the fact that the password hashing is done on the non-truncated password if PAM is not used. However when PAM is used (which is the default and only supported configuration in RHEL) the password is truncated when unix_chkpwd is invoked during the PAM authentication.

Comment 13 Huzaifa S. Sidhpurwala 2020-03-26 07:57:13 UTC
Explanation of Mitigation:

OpenSSH in RHEL 6, 7 and 8 uses a helper binary "unix_chkpwd" (via the pam_unix module) to verify the passwords. Even when long passwords are passed to OpenSSH, they are truncated to 512 bytes when passed to the helper binary. Hence, RHEL 6 and 7 are not affected by this denial of service attack which utilizes very long passwords.

Red Hat Enterprise Linux 6, 7 and 8 ship with SELinux enabled by default. However, the helper binary "unix_chkpwd" (the usage of which mitigates this flaw) is not used when SELinux is disabled. Disabling SELinux exposes the OpenSSH software to this flaw.

Comment 14 Huzaifa S. Sidhpurwala 2020-03-26 07:57:20 UTC
Statement:

This issue in OpenSSH is mitigated by the usage of SELinux in Red Hat Enterprise Linux 6, 7 and 8. More details available at: https://bugzilla.redhat.com/show_bug.cgi?id=1364935#c13