Shell command injection - samba-tool domain classicupgrade
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
samba (Ubuntu) |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Attached screenshot
This python script allows the shell code injection :
/usr/lib/
This function uses os.popen() wich injects the command in testparm, varname and the path to the smbconf :
def get_testparm_
cmd = "%s -s -l --parameter-
output = os.popen(cmd, 'r').readline()
return output.strip()
--> So please use subprocess.Popen() , not os.popen()
Demo Exploit :
=============
1) Put a shell command in the folder name , e.g. ";xeyes;#"
/home/theregrun
<theregrunner is my user name, you change this to your user name>
2) start samba tool like this :
sudo samba-tool domain classicupgrade '/home/
3) Now the xeyes program runs as root
ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: samba-common-bin 2:4.1.17+
ProcVersionSign
Uname: Linux 4.2.0-17-generic x86_64
NonfreeKernelMo
ApportVersion: 2.19.1-0ubuntu4
Architecture: amd64
CurrentDesktop: Unity
Date: Sat Nov 7 09:01:35 2015
InstallationDate: Installed on 2015-10-22 (15 days ago)
InstallationMedia: Ubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
SambaServerRegr
SmbConfIncluded: No
SourcePackage: samba
UpgradeStatus: No upgrade log present (probably fresh install)
WindowsFailedCo
Hi Bernd - Thanks for reporting this to us!
I don't feel like there's much of a chance that an attacker could control the path to the smb.conf file. This feels like a normal bug to me.
Have you reported this issue to upstream Samba? I think we'd prefer to wait for them to fix this upstream and for it to eventually make its way into Ubuntu rather than performing security updates to address this.