Bug 1195729 (CVE-2015-0283) - CVE-2015-0283 slapi-nis: infinite loop in getgrnam_r() and getgrgid_r()
Summary: CVE-2015-0283 slapi-nis: infinite loop in getgrnam_r() and getgrgid_r()
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2015-0283
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1202995 1202996 1206049
Blocks: 1195735
TreeView+ depends on / blocked
 
Reported: 2015-02-24 13:26 UTC by Martin Prpič
Modified: 2019-09-29 13:28 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
It was discovered that the slapi-nis Directory Server plug-in did not correctly perform memory reallocation when handling user account information. A request for information about a group with many members, or a request for a user that belongs to a large number of groups, would cause a Directory Server to enter an infinite loop and consume an excessive amount of CPU time.
Clone Of:
Environment:
Last Closed: 2019-06-08 02:39:02 UTC


Attachments (Terms of Use)
patch 1 makes use of libnss_sss.so.2 directly (13.65 KB, patch)
2015-02-24 18:02 UTC, Alexander Bokovoy
no flags Details | Diff
patch 2 store the length of reallocated chunk (1.34 KB, patch)
2015-02-24 18:04 UTC, Alexander Bokovoy
no flags Details | Diff
patch 3 make default nss buffer larger (1.39 KB, patch)
2015-02-25 10:23 UTC, Alexander Bokovoy
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0728 normal SHIPPED_LIVE Moderate: ipa and slapi-nis security and bug fix update 2015-03-26 19:50:25 UTC

Description Martin Prpič 2015-02-24 13:26:13 UTC
It was discovered that the slapi-nis Directory Server plug-in did not correctly perform memory reallocation when handling user account information. A request for information about a group with many members, or a request for a user that belongs to a large number of groups, would cause a Directory Server to enter an infinite loop and consume an excessive amount of CPU time.

Acknowledgements:

This issue was discovered by Sumit Bose of Red Hat.

Comment 2 Alexander Bokovoy 2015-02-24 18:02:47 UTC
Created attachment 994786 [details]
patch 1 makes use of libnss_sss.so.2 directly

First patch in a series to fix the issue. We have two separate problems that cause deadlock: one is resizing issue (coming in patch 2) and another is traversing of NSS stack for all requests for user/group names (patch 1). The latter is amplifying the issue with realloc() because nss_files.so.2 is always in the NSS stack and will always lock up access to /etc/group or /etc/passwd for other threads.

Comment 3 Alexander Bokovoy 2015-02-24 18:04:10 UTC
Created attachment 994788 [details]
patch 2 store the length of reallocated chunk

Patch 2 makes sure we remember new size of the reallocated memory.

Comment 4 Alexander Bokovoy 2015-02-25 10:23:11 UTC
Created attachment 995077 [details]
patch 3 make default nss buffer larger

Patch 3 makes sure the default buffer size is of reasonable size -- initial buffer size for getgrnam/getgrgid in glibc is about 1KiB while for typical AD environments group information may occupy a larger space. Use 16KiB by default.

Comment 5 Alexander Bokovoy 2015-02-25 10:23:49 UTC
Comment on attachment 995077 [details]
patch 3 make default nss buffer larger

wrong MIME type

Comment 37 Francisco Alonso 2015-03-24 14:10:49 UTC
Splitting IPA memory corruption issue when using get_user_grouplist() to separate bug 1205200 with the CVE-2015-1827 assigned.

Comment 38 Tomas Hoger 2015-03-26 08:11:51 UTC
Created slapi-nis tracking bugs for this issue:

Affects: fedora-all [bug 1206049]

Comment 39 errata-xmlrpc 2015-03-26 15:50:33 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

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

Comment 40 Fedora Update System 2015-03-31 21:55:03 UTC
freeipa-4.1.4-1.fc22, slapi-nis-0.54.2-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 41 Fedora Update System 2015-04-06 08:32:32 UTC
freeipa-4.1.4-1.fc21, slapi-nis-0.54.2-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.