TUCoPS :: SunOS/Solaris :: c07-2225.htm

Buffer overrun in nss_winbind.so.1 on Solaris
CVE-2007-0453: Buffer overrun in nss_winbind.so.1 on Solaris
CVE-2007-0453: Buffer overrun in nss_winbind.so.1 on Solaris



This is a multi-part message in MIME format.
--------------060704040606090706050900
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

============================================================ Subject:     Buffer overrun in NSS host lookup Winbind
==		library on Solaris
== CVE ID#:     CVE-2007-0453
=== Versions:    Samba 3.0.21 - 3.0.23d (inclusive) running on
==		Sun Solaris
=== Summary:     A potential overrun in the gethostbyname()
==		and getipnodebyname() in the nss_winbind.so.1
==		library on Solaris can potentially allow
==		for code execution.
==========================================================
==========Description
==========
NOTE: This security advisory only affects Sun Solaris
systems running Samba's winbindd daemon and configured to
make use of the nss_winbind.so.1 library for gethostbyname()
and getipnodebyname() name resolution queries.  For example,

	## /etc/nsswitch.conf
	...
	ipnodes: files winbind
	hosts: files winbind

The buffer overrun is caused by copying a string passed
into the NSS interface into a static buffer prior to sending
the request to the winbindd daemon.


=================Patch Availability
=================
A patch against Samba 3.0.23d has been attached to this
email.  This fix has be incorporated into the Samba 3.0.24
release.  Patches are also available from at the Samba Security
page (http://www.samba.org/samba/security). 

=========Workaround
=========
An unpatched Solaris server may be protected by removing
the 'winbind' entry from the hosts and ipnodes services in
/etc/nsswitch.conf.


======Credits
======
This vulnerability was reported (including a proposed patch)
to Samba developers by Olivier Gay . Much thanks 
to Olivier for his cooperation and patience in the announcement
of this defect.  The time line is as follows:

* Dec 15, 2006: Defect first reported to the security@samba.org 
  email alias.
* Dec 21, 2006: Initial developer response by Andrew Tridgell
  confirming the issue.
* Jan 29, 2007: Announcement to vendor-sec mailing list
* Feb 5, 2007: Public issue of security advisory.


=========================================================== Our Code, Our Bugs, Our Responsibility.
== The Samba Team
=========================================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org 

iD8DBQFFxzAOIR7qMdg1EfYRAgUoAKCq+KSsNDdpUnToyFtNoMDckMKLHACfet2h
uQ+KAyjI8jTU6nAZHY3v+vI=f1TQ
-----END PGP SIGNATURE-----

--------------060704040606090706050900
Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0";
 name="winbind_nss_solaris.patch.asc"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="winbind_nss_solaris.patch.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQBFvqTIIR7qMdg1EfYRAtaeAJ481DWXPQZcVTGpVT08I3JL3MSa/wCgsrHG
TVy0PqEZqIscoUa0DBegnL4=sQHh
-----END PGP SIGNATURE-----













--------------060704040606090706050900
Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0";
 name="winbind_nss_solaris.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="winbind_nss_solaris.patch"

diff -urN samba-3.0.23d/source/nsswitch/winbind_nss_solaris.c samba/source/nsswitch/winbind_nss_solaris.c
--- samba-3.0.23d/source/nsswitch/winbind_nss_solaris.c	2006-04-19 21:29:21.000000000 -0500
+++ samba/source/nsswitch/winbind_nss_solaris.c	2007-01-29 19:51:11.000000000 -0600
@@ -493,7 +493,8 @@
 	af = AF_INET6;
 #endif
 
-	strncpy(request.data.winsreq, argp->key.name, strlen(argp->key.name)) ;
+	strncpy(request.data.winsreq, argp->key.name, sizeof(request.data.winsreq) - 1);
+	request.data.winsreq[sizeof(request.data.winsreq) - 1] = '\0';
 
 	if( (ret = winbindd_request_response(WINBINDD_WINS_BYNAME, &request, &response))
 		== NSS_STATUS_SUCCESS ) {
@@ -515,7 +516,8 @@
 	ZERO_STRUCT(response);
 	ZERO_STRUCT(request);
 	
-	strncpy(request.data.winsreq, argp->key.name, strlen(argp->key.name));
+	strncpy(request.data.winsreq, argp->key.name, sizeof(request.data.winsreq) - 1);
+	request.data.winsreq[sizeof(request.data.winsreq) - 1] = '\0';
 
 	if( (ret = winbindd_request_response(WINBINDD_WINS_BYNAME, &request, &response))
 		== NSS_STATUS_SUCCESS ) {













--------------060704040606090706050900--


TUCoPS is optimized to look best in Firefox® on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2024 AOH