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

SecurityTracker
Archives


Welcome to SecurityTracker!
 
Click to Sign Up
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

Sign Up!





Category:  Application (File Transfer/Sharing)  >  Samba CIFS Vendors:  Samba.org
Samba QFILEPATHINFO Buffer Overflow Lets Remote Authenticated Users Execute Arbitrary Code
SecurityTracker Alert ID:  1012235
SecurityTracker URL:  http://securitytracker.com/id?1012235
CVE Reference:  CAN-2004-0882   (Links to External Site)
Date:  Nov 15 2004
Impact:  Execution of arbitrary code via network, User access via network
Vendor Confirmed:  Yes  
Advisory:  e-matters
Version(s): 3.0 - 3.0.7
Description:  A vulnerability was reported in Samba in the processing of QFILEPATHINFO requests. A remote authenticated user can execute arbitrary code on the target system.

Stefan Esser of e-matters GmbH reported that a remote authenticated user can send a specially crafted TRANSACT2_QFILEPATHINFO request for a specially crafted filename containing unicode characters to trigger a buffer overflow. When the filename's unicode characters are converted by the target server in constructing the reply, the space allocated by the server may be overflowed.

If the filename does not already exist on the target server, the remote authenticated user must have write access to create the specially crafted filename before issuing the request.

The vendor was notified on September 24, 2004.

Default installations are affected.

The original advisory is available at:

http://security.e-matters.de/advisories/132004.html

Impact:  A remote authenticated user can execute arbitrary code on the target system.
Solution:  The vendor has released a fixed version (3.0.8), available at:

http://www.samba.org/samba/download/

Vendor URL:  www.samba.org/ (Links to External Site)
Cause:  Boundary error

Message History:   This archive entry has one or more follow-up message(s) listed below.
Nov 19 2004 (Red Hat Issues Fix) Samba QFILEPATHINFO Buffer Overflow Lets Remote Authenticated Users Execute Arbitrary Code   (bugzilla@redhat.com)
Red Hat has released a fix for Red Hat Enterprise Linux 2.1 and 3.
Nov 19 2004 (Mandrake Issues Fix) Samba QFILEPATHINFO Buffer Overflow Lets Remote Authenticated Users Execute Arbitrary Code   (Mandrake Linux Security Team <security@linux-mandrake.com>)
Mandrake has released a fix.
Nov 26 2004 (Conectiva Issues Fix) Samba QFILEPATHINFO Buffer Overflow Lets Remote Authenticated Users Execute Arbitrary Code   (Conectiva Updates <secure@conectiva.com.br>)
Conectiva has released a fix.
Nov 30 2004 (Fedora Issues Fix for FC2) Samba QFILEPATHINFO Buffer Overflow Lets Remote Authenticated Users Execute Arbitrary Code   (Jay Fenlason <fenlason@redhat.com>)
Fedora has released a fix for Fedora Core 2.
Nov 30 2004 (Fedora Issues Fix for FC3) Samba QFILEPATHINFO Buffer Overflow Lets Remote Authenticated Users Execute Arbitrary Code   (Jay Fenlason <fenlason@redhat.com>)
Fedora has released a fix for Fedora Core 3.



 Source Message Contents

Date:  Sun, 14 Nov 2004 18:22:33 -0500
Subject:  http://security.e-matters.de/advisories/132004.html

 
 
                           e-matters GmbH
                          www.e-matters.de
 
                      -= Security  Advisory =-
 
 
 
     Advisory: Samba 3.x QFILEPATHINFO unicode filename buffer overflow
 Release Date: 2004/11/15
Last Modified: 2004/11/15
       Author: Stefan Esser [s.esser@e-matters.de]
 
  Application: Samba 3 <= 3.0.7
     Severity: A buffer overflow inside the QFILEPATHINFO request 
               handler allows remote code execution
         Risk: Critical
Vendor Status: Vendor has released a bugfixed version.
    Reference: http://security.e-matters.de/advisories/132004.html
 
 
Overview:
 
   Samba is an Open Source/Free Software suite that provides seamless 
   file and print services to SMB/CIFS clients. Samba is freely 
   available under the GNU General Public License.
   
   During an audit of the Samba 3.x codebase a unicode filename buffer
   overflow within the handling of TRANSACT2_QFILEPATHINFO replies
   was discovered that allows remote execution of arbitrary code.
   
   Exploiting this vulnerability is possible through every Samba user
   if a special crafted pathname exists. If such a path does not exist
   the attacker needs write access to one of the network shares.
   
 
Details:
   
   The SMB specification allows clients to specify a maximum amount
   of data bytes that the server is allowed to return in a single 
   reply. 
 
   When Samba 3.x receives a TRANSACT2_QFILEPATHINFO request with
   this field set to f.e. zero this can lead to an overflow of a
   unicode filename when constructing the reply.
   
   This is caused by the fact that Samba <= 3.0.7 reads this field,
   allocates 1024 bytes more than wanted and then writes the reply
   into this buffer without any kind of size check. While this
   behaviour was sufficient enough to protect against overflows in
   Samba 2.x the correction of the replies for the info_levels
   SMB_QUERY_FILE_NAME_INFO and SMB_QUERY_FILE_ALL_INFO to unicode
   full pathname strings allows overflowing the reserved buffer
   size.
   
   By using unicode chars within filenames this allows to overwrite
   malloc()/free() control structures and therefore allows remote
   code execution.
  
 
Proof of Concept:
 
   e-matters is not going to release an exploit for this vulnerability
   to the public.
   
 
Disclosure Timeline:
 
   24. September 2004 - Made initial contact with the Samba Team
   25. September 2004 - Samba Team has fixed the bug in CVS
   26. September 2004 - Disclosure was delayed on our side because 
                        of another issue that was suppossed to get
			disclosed at the same time
   08. November  2004 - Samba Team released 3.0.8 without noticing
                        us because they were wrongly convinced
			that the bug is not exploitable
   15. November  2004 - Public Disclosure
 
   
CVE Information:
 
   The Common Vulnerabilities and Exposures project (cve.mitre.org) has
   assigned the name CAN-2004-0882 to this issue.
 
 
Recommendation:
 
   Unlike several other Samba vulnerabilities within the last months
   this vulnerability affects default installations of Samba 3.x and
   therefore any user of Samba 3 <= 3.0.7 should upgrade as soon as
   possible.
   
   
GPG-Key:
 
   http://security.e-matters.de/gpg_key.asc
    
   pub  1024D/3004C4BC 2004-05-17 e-matters GmbH - Securityteam 
   Key fingerprint = 3FFB 7C86 7BE8 6981 D1DA  A71A 6F7D 572D 3004 C4BC
 
 
Copyright 2004 Stefan Esser. All rights reserved.
 


Go to the Top of This SecurityTracker Archive Page





Home   |    View Topics   |    Search   |    Contact Us   |    Help

Copyright 2004, SecurityGlobal.net LLC