SecurityTracker.com
Keep Track of the Latest Vulnerabilities
with SecurityTracker!
    Home    |    View Topics    |    Search    |    Contact Us    |   

SecurityTracker
Archives


 
Sign Up
Sign Up for Your FREE Weekly SecurityTracker E-mail Alert Summary
Instant Alerts
Buy our Premium Vulnerability Notification Service to receive customized, instant alerts
Affiliates
Put SecurityTracker Vulnerability Alerts on Your Web Site -- It's Free!
Partners
Become a Partner and License Our Database or Notification Service
Report a Bug
Report a vulnerability that you have found to SecurityTracker
bugs
@
securitytracker.com






Category:   Application (File Transfer/Sharing)  >   Samba Vendors:   Samba.org
Samba Buffer Overflow in call_trans2open() Function Lets Remote Users Execute Arbitrary Code With Root Privileges
SecurityTracker Alert ID:  1006497
SecurityTracker URL:  http://securitytracker.com/id/1006497
CVE Reference:   CAN-2003-0201   (Links to External Site)
Date:  Apr 7 2003
Impact:   Execution of arbitrary code via network, Root access via network
Fix Available:  Yes  Vendor Confirmed:  Yes  Exploit Included:  Yes  
Version(s): prior to 2.2.8a, also 2.0.10 and prior
Description:   A buffer overflow vulnerability was reported in Samba. A remote user can gain root access on the target system.

Digital Defense reported that a remote user can trigger a buffer overflow in the call_trans2open() function in the 'trans2.c' file. The function performs a StrnCpy() operation using a length variable that is 1 byte too long, according to the report. Digital Defense warned that a remote user can exploit this flaw to execute arbitrary code with root privileges.

A scanning utility to assist in identifying hosts running Samba is available at:

http://www.digitaldefense.net/labs/tools/nmbping.pl

A demonstration exploit is available at:

http://www.digitaldefense.net/labs/tools/trans2root.pl

Impact:   A remote user can execute arbitrary code with root privileges to gain root access on the system.
Solution:   The vendor has released a fixed version (2.2.8a), available at:

http://samba.org/samba/ftp/samba-2.2.8a.tar.gz

A patch file against 2.2.8 is also available:

http://samba.org/samba/ftp/patches/patch-2.2.8-2.2.8a.diffs.gz

The vendor reports that alpha versions of Samba 3.0 and above are not vulnerable.

A rollup patch for release 2.2.7a and 2.0.10 that fixes both this vulnerability and the one described in CAN-2003-0085 is available at:

http://us1.samba.org/samba/ftp/patches/security/

Vendor URL:  www.samba.org/ (Links to External Site)
Cause:   Boundary error
Underlying OS:   Linux (Any), UNIX (Any)

Message History:   This archive entry has one or more follow-up message(s) listed below.
(SuSE Issues Fix) Samba Buffer Overflow in call_trans2open() Function Lets Remote Users Execute Arbitrary Code With Root Privileges   (Roman Drahtmueller <draht@suse.de>)
SuSE has released a fix.
(Debian Issues Fix) Samba Buffer Overflow in call_trans2open() Function Lets Remote Users Execute Arbitrary Code With Root Privileges   (joey@infodrom.org (Martin Schulze))
Debian has released a fix.
(Mandrake Issues Fix) Samba Buffer Overflow in call_trans2open() Function Lets Remote Users Execute Arbitrary Code With Root Privileges   (Mandrake Linux Security Team <security@linux-mandrake.com>)
Mandrake has released a fix.
(Immunix Issues Fix) Samba Buffer Overflow in call_trans2open() Function Lets Remote Users Execute Arbitrary Code With Root Privileges   (Immunix Security Team <security@wirex.com>)
Immunix has released a fix.
(Slackware Issues Fix) Samba Buffer Overflow in call_trans2open() Function Lets Remote Users Execute Arbitrary Code With Root Privileges   (Slackware Security Team <security@slackware.com>)
Slackware has released a fix.
(FreeBSD Issues Fix) Samba Buffer Overflow in call_trans2open() Function Lets Remote Users Execute Arbitrary Code With Root Privileges   (FreeBSD Security Advisories <security-advisories@freebsd.org>)
FreeBSD has released a fix.
(Red Hat Issues Fix) Samba Buffer Overflow in call_trans2open() Function Lets Remote Users Execute Arbitrary Code With Root Privileges   (bugzilla@redhat.com)
Red Hat has released a fix.
(Trustix Issues Fix) Samba Buffer Overflow in call_trans2open() Function Lets Remote Users Execute Arbitrary Code With Root Privileges   (Trustix Secure Linux Advisor <tsl@trustix.com>)
Trustix has released a fix.
(Conectiva Issues Fix) Samba Buffer Overflow in call_trans2open() Function Lets Remote Users Execute Arbitrary Code With Root Privileges   (Conectiva Updates <secure@conectiva.com.br>)
Conectiva has released a fix.
(HP Issues Fix for CIFS Server) Samba Buffer Overflow in call_trans2open() Function Lets Remote Users Execute Arbitrary Code With Root Privileges   (support_feedback@us-support2-mail.external.hp.com (IT Resource Center ))
HP has released a fix for CIFS/9000 Server.
(Red Hat Adds Fix for 7.1) Samba Buffer Overflow in call_trans2open() Function Lets Remote Users Execute Arbitrary Code With Root Privileges   (bugzilla@redhat.com)
Red Hat has added a fix for Red Hat Linux 7.1.
(SGI Issues Fix) Re: Samba Buffer Overflow in call_trans2open() Function Lets Remote Users Execute Arbitrary Code With Root Privileges   (SGI Security Coordinator <agent99@sgi.com>)
SGI has issued a fix for IRIX.



 Source Message Contents

Date:  Mon, 7 Apr 2003 07:44:58 +0000 (UTC)
Subject:  [VulnWatch] [DDI-1013] Buffer Overflow in Samba allows remote root compromise


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


|------------------------------------------------------------------------------|
 Digital Defense Inc. Security Advisory DDI-1013        labs@digitaldefense.net
 http://www.digitaldefense.net/
|------------------------------------------------------------------------------|

Synopsis          : Buffer Overflow in Samba allows remote root compromise
Package           : Samba, Samba-TNG
Type              : Remote Root Compromise
Issue date        : 04-07-2003
Versions Affected : < Samba 2.2.8a, <= Samba 2.0.10,  < Samba-TNG 0.3.2
Not Affected      : Samba 3.0 Alpha Versions, CVS Versions of Samba-TNG
CVE Id            : CAN-2003-0201

|------------------------------------------------------------------------------|


o Product description:
   Samba is an Open Source/Free Software suite that provides seamless file and
   print services to SMB/CIFS clients. Samba-TNG was originally a fork off of
   the Samba source tree, and aims at being a substitute for a Windows NT domain
   controller.


o Problem description:
   An anonymous user can gain remote root access due to a buffer overflow caused
   by a StrnCpy() into a char array (fname) using a non-constant length
   (namelen).

   StrnCpy(fname,pname,namelen);    /* Line 252 of smbd/trans2.c */

   In the call_trans2open function in trans2.c, the Samba StrnCpy function
   copies pname into fname using namelen. The variable namelen is assigned the
   value of strlen(pname)+1, which causes the overflow.

   The variable 'fname' is a _typedef_ pstring, which is a char with a size of
   1024. If pname is greater than 1024, you can overwrite almost anything you
   want past the 1024th byte that fits inside of sizeof(pname), or the value
   returned by SVAL(inbuf,smbd_tpscnt) in function reply_trans2(), which should
   be around 2000 bytes.

   The Common Vulnerabilities and Exposures (CVE) project has assigned the name
   CAN-2003-0201 to this issue. This is a candidate for inclusion in the CVE
   list (http://cve.mitre.org), which standardizes names for security problems.


o Testing Environment:
   Tested against source compiles and binary packages of Samba from version
   2.2.5 to 2.2.8 on the following x86 platforms:

   Redhat Linux 7.1, 7.3, 8.0
   Gentoo Linux 1.4-rc3
   SuSe Linux 7.3
   FreeBSD 4.6, 4.8, 5.0
   Solaris 9


o Solutions and Workarounds:
   Upgrading to the latest version of Samba or Samba-TNG is the recommended
   solution to this vulnerability. Samba version 2.2.8a, and Samba-TNG version
   0.3.2 are not vulnerable. There will be no new releases for the 2.0 line of
   Samba code. The only fix for Samba 2.0 is to apply the patches that Samba is
   providing.

   A workaround in the current source code for this specific vulnerability
   would be to modify the StrnCpy line found at line 250 in smbd/trans2.c in the
   Samba 2.2.8 source code:

   -StrnCpy(fname,pname,namelen);
   +StrnCpy(fname,pname,MIN(namelen, sizeof(fname)-1));

   As a result of this vulnerability being identified at least three others
   have also been found by the Samba team after reviewing similar usages in the
   source tree. One is a static overflow and the other two are heap overflows.
   Applying the fix above will only protect against the specific problem
   identified in this advisory. To fully protect yourself, you must apply the
   patches from Samba, or upgrade to 2.2.8a.

   Samba is available for download from: http://www.samba.org/
   Samba-TNG is available for download from: http://www.samba-tng.org/


o Exploit:
   An exploit named trans2root.pl has been posted on the Digital Defense, Inc.
   website. A quick udp based based scanner named nmbping.pl has also been
   posted to assist you in identifying Samba servers on your network. Both are
   available for download from the following URL:

   http://www.digitaldefense.net/labs/securitytools.html

   This exploit works against all distributions listed in the testing
   environment section. Usage is as follows:

   trans2root.pl <options> -t <target type> -H <your ip> -h <target ip>

   This exploit should work against all x86 Linux, Solaris, and  FreeBSD hosts
   running the 2.2.x branch of Samba. Hosts with a non-executable stack are not
   vulnerable to this particular exploit. The exploit will cause the target host
   to connect back to the host running the exploit and spawn a root shell on the
   defined port (default is 1981).

   The scanner is very easy to use, and should detect and identify Samba and
   Windows SMB services. Usage is as follows:

   nmbping.pl <network/cidr>


o Forced Release:
   This vulnerability is being actively exploited in the wild. Digital Defense,
   Inc. discovered this bug by analyzing a packet capture of an attack against a
   host running Samba 2.2.8. The attack captured was performed on April 1st,
   2003. Samba users are urged to check their Samba servers for signs of
   compromise. Samba and Digital Defense, Inc. decided to release their
   advisories before all vendors had a chance to update their packages due to
   this vulnerability being actively exploited.


o Revision History:
   04-07-2003     Initial public release

   Latest revision available at:
   http://www.digitaldefense.net/labs/advisories.html


o Vendor Contact Information:
   04-03-2003     security@samba.org notified
   04-03-2003     elrond@samba-tng.org notified.
   04-03-2003     Samba Team responds via telephone, acknowledges vulnerability
   04-03-2003     Elrond of Samba-TNG responds and acknowledges vulnerability
   04-04-2003     Samba Team notifies vendorsec mailing list
   04-07-2003     Initial public release

o Thanks to:
   Elrond of Samba-TNG, The Samba Security Team, and everyone on the
   Digital Defense Inc., SECOPS team.

-----BEGIN PGP SIGNATURE-----

iD8DBQE+kT/5jB+XO4ZKjSARAsJpAJsH05MqOIqauWrK1kKOAkwmCsXorgCeK92r
eDEmOgRY4z7Y0b7HecHyf+A=
=Af+n
-----END PGP SIGNATURE-----


 
 


Go to the Top of This SecurityTracker Archive Page





Home   |    View Topics   |    Search   |    Contact Us

Copyright 2013, SecurityGlobal.net LLC