Bug 1228571 (CVE-2015-3238)

Summary: CVE-2015-3238 pam: DoS/user enumeration due to blocking pipe in pam_unix module
Product: [Other] Security Response Reporter: Stefan Cornelius <scorneli>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: carnil, jrusnack, rajashokkumar, security-response-team, tmraz
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
It was discovered that the _unix_run_helper_binary() function of PAM's unix_pam module could write to a blocking pipe, possibly causing the function to become unresponsive. An attacker able to supply large passwords to the unix_pam module could use this flaw to enumerate valid user accounts, or cause a denial of service on the system.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-08 02:41:35 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: 1233234, 1233236, 1249067, 1249068, 1249069, 1249070    
Bug Blocks: 1222875    
Attachments:
Description Flags
The patch limiting the supported password length to 512 bytes none

Description Stefan Cornelius 2015-06-05 08:46:24 UTC
From the original report:
"If SELinux is enabled, the _unix_run_helper_binary function in Linux-PAM 1.1.8
and earlier hangs indefinitely when verifying a password of 65536 characters,
which allows attackers to conduct username enumeration and denial of service
attacks.

When supplying a password of 65536 characters or more, the process will block
on the write(2) call at modules/pam_unix/support.c:614 because it tries to
write strlen(passwd)+1 bytes to a blocking pipe and a pipe has a limited
capacity of 65536 bytes on Linux."

Acknowledgements:

Red Hat would like to thank Sebastien Macke of Trustwave SpiderLabs for reporting this issue.

Comment 2 Tomas Mraz 2015-06-15 09:27:29 UTC
So we (as PAM upstream developers) acknowledge the issue. I developed a patch that was reviewed by peer upstream developers and we will do a release after vendor notification.
Can we get a CVE assigned?

Comment 3 Tomas Mraz 2015-06-15 09:29:24 UTC
Created attachment 1038860 [details]
The patch limiting the supported password length to 512 bytes

Comment 12 Stefan Cornelius 2015-06-25 18:56:15 UTC
Public via: http://www.openwall.com/lists/oss-security/2015/06/25/13

Comment 13 Fedora Update System 2015-06-30 20:20:41 UTC
pam-1.1.8-19.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2015-07-03 18:39:08 UTC
pam-1.1.8-19.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Ashok Kumar Rajendran 2015-07-06 23:52:30 UTC
In the patch provided

linux-pam/modules/pam_unix/pam_unix_passwd.c
 static int _unix_run_update_binary

There is a "else" missing for both "if (fromwhat) " and "if (towhat)", Hence this ends up in writing  "pam_modutil_write(fds[1], "", 1);" irrespective of the value. Is it something expected or is it a bug in the patch?

Thanks,
-

Comment 16 Tomas Mraz 2015-07-07 07:51:24 UTC
Yes, that is fully intentional as we need to write the NULL byte as well.

Comment 19 errata-xmlrpc 2015-08-18 18:45:47 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7
  Red Hat Enterprise Linux 6

Via RHSA-2015:1640 https://rhn.redhat.com/errata/RHSA-2015-1640.html