Samba smbd Integer Overflow in Allocating Security Descriptors May Let Remote Users Execute Arbitrary Code
SecurityTracker Alert ID: 1012587|
SecurityTracker URL: http://securitytracker.com/id/1012587
(Links to External Site)
Updated: Jan 12 2006|
Original Entry Date: Dec 16 2004
Execution of arbitrary code via network, Root access via network|
Fix Available: Yes Vendor Confirmed: Yes |
Version(s): 2.0.x, 2.2.x, and 3.0.x through 3.0.9|
iDEFENSE reported an integer overflow vulnerability in Samba smbd in the processing of MS-RPC requests. A remote authenticated user can execute arbitrary code with root privileges.|
It is reported that there is a security descriptor integer overflow. A remote authenticated user can send specially crafted SMB messages to the target smb server to trigger a heap overflow during the allocation of memory to store the descriptors and execute arbitrary code.
Greg MacManus of iDEFENSE Labs is credited with discovering this flaw.
The original advisory is available at:
A remote authenticated user may be able to execute arbitrary code on the target system with root privileges.|
The vendor has issued a fixed version (3.0.10), available at:|
A patch for Samba 3.0.9 (samba-3.0.9-CAN-2004-1154.patch) is also available at:
Vendor URL: samba.org/samba/security/CAN-2004-1154.html (Links to External Site)
Linux (Any), UNIX (Any)|
This archive entry has one or more follow-up message(s) listed below.|
Source Message Contents
Date: Thu, 16 Dec 2004 09:15:14 -0500|
Subject: iDEFENSE Security Advisory 12.16.04: Samba smbd Security Descriptor
Samba smbd Security Descriptor Integer Overflow Vulnerability
iDEFENSE Security Advisory 12.16.04
December 16, 2004
Samba is an open source implementation of the SMB/CIFS protocol which
allows Windows clients to use resources on non-Windows systems. More
information is available at http://www.samba.org/
Remote exploitation of an integer overflow vulnerability in all
versions of Samba's smbd prior to and including 3.0.8 could allow an
attacker to cause controllable heap corruption, leading to execution
of arbitrary commands with root privileges.
To open a file on a Samba server, a client sends a sequence of SMB
messages to the smbd process. The message with the information on the
file to open also contains a security descriptor, which is a list of
access controls to apply to the file. The vulnerability specifically
occurs in the allocation of memory to store these descriptors.
* Even if the num_aces is zero, allocate memory as there's a
* between a non-present DACL (allow all access) and a DACL with no
* (allow no access).
if((psa->ace = (SEC_ACE *)prs_alloc_mem(ps,sizeof(psa->ace) *
(psa->num_aces+1))) == NULL)
When more than 38347922 descriptors are requested, an integer
overflow occurs resulting in less memory being allocated than was
requested. sizeof(psa->ace) is 112, or 0x70 in hex.
0x70x(38347922 + 1)=4294967376, or 0x100000050. This number is larger
than can be stored in a 32-bit integer, so the bits that don't fit
are removed, leaving 0x50, or 80 in decimal. As one descriptor is 112
bytes, an overflow of at least 32 bytes will occur.
An attacker could supply data to the server which would cause the
heap to become corrupted in such a way as to cause arbitrary values
to be written to arbitrary locations, eventually leading to code
Successful remote exploitation allows an attacker to gain root
privileges on a vulnerable system. In order to exploit this
vulnerability an attacker would need to have credentials allowing
them access to the a share. Unsuccessful exploitation attempts will
cause the process serving the request to crash with signal 11, and
may leave evidence of an attack in logs.
iDEFENSE Labs have confirmed that Samba 3.0.8 and 2.2.9 are
vulnerable. Checks made against earlier versions of the source code
suggest that all versions from at least 2.0.0 are also vulnerable to
some minor variation of this vulnerability.
Employ firewalls, access control lists or other TCP/UDP restriction
mechanisms to limit access to systems and services.
VI. VENDOR RESPONSE
Patches for this issue are available at:
VII. CVE INFORMATION
The Common Vulnerabilities and Exposures (CVE) project has assigned the
names CAN-2004-1154 to these issues. This is a candidate for inclusion
in the CVE list (http://cve.mitre.org), which standardizes names for
VIII. DISCLOSURE TIMELINE
12/02/2004 Initial vendor notification
12/02/2004 Initial vendor response
12/16/2004 Coordinated public disclosure
This vulnerability was discovered by Greg MacManus, iDEFENSE Labs.
Get paid for vulnerability research
X. LEGAL NOTICES
Copyright (c) 2004 iDEFENSE, Inc.
Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDEFENSE. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically,
please email firstname.lastname@example.org for permission.
Disclaimer: The information in the advisory is believed to be
accurate at the time of publishing based on currently available
information. Use of the information constitutes acceptance for use in
an AS IS condition. There are no warranties with regard to this
information. Neither the author nor the publisher accepts any
liability for any direct, indirect, or consequential loss or damage
arising from use of, or reliance on, this information.