Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Forum Archive > Main Support Categories > Hardware & Laptops
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.

Hardware & Laptops
Problems with hardware & laptops not being detected or supported during or after install.

 
 
Thread Tools Display Modes
Old July 14th, 2007   #1
poupoul2
First Cup of Ubuntu
 
Join Date: Mar 2007
Beans: 2
Exclamation Samsung drivers changing system rights

Hi all.

Just to inform you about a recent post on the french Ubuntu forum about Samsung drivers (sorry, in french). It appears that Samsung unified drivers change rights on some parts of the system: After installing the drivers, applications may launch using root rights, without asking any password.

What is more, you may be able to kill your system, by deleting system components, generally modifiable only by using sudo.

The dangerous drivers are here

I am not a Samsung device user, but i assume some of you are. Sorry if the news have already spread here

EDIT: The hack part of the drivers
Code:
wrap_setuid_third_party_application xsane
        wrap_setuid_third_party_application xscanimage

        wrap_setuid_ooo_application soffice
        wrap_setuid_ooo_application swriter
        wrap_setuid_ooo_application simpress
        wrap_setuid_ooo_application scalc
and
Code:
wrap_setuid_third_party_application() {
        if echo "$1" | grep -q "/" ; then
                APP_NAME=$1
        else
                APP_NAME=`which $1 2> /dev/null`
        fi
        NEW_NAME=${APP_NAME}.bin

        if test -n "$APP_NAME" ; then
                if ! test -f "$NEW_NAME" && ! test -d "$NEW_NAME"; then
                        mv "$APP_NAME" "$NEW_NAME"
                        cp -af /opt/${VENDOR}/mfp/bin/suwrap "$APP_NAME"
                        chown root:root "$APP_NAME"
                        chmod 4755 "$APP_NAME"
                fi
        fi
}

wrap_setuid_ooo_application() {
        WRAPPING_BIN=`ls /usr/lib*/*/program/$1.bin /opt/*/program/$1.bin 2> /de
v/null | head -1`
        if test -n "$WRAPPING_BIN" ; then
                ${2}wrap_setuid_third_party_application $WRAPPING_BIN
        fi
}
Those sections should be commented out

And give to /etc root privileges
Code:
sudo chown root -R /etc

Last edited by poupoul2; July 14th, 2007 at 12:04 PM..
poupoul2 is offline  
Old July 14th, 2007   #2
hyg53
5 Cups of Ubuntu
 
hyg53's Avatar
 
Join Date: Sep 2005
Beans: 19
Re: Samsung drivers changing rights

I really would like to know the name of the guy responsible for this hack...
__________________
no signature, thanks!
hyg53 is offline  
Old July 14th, 2007   #3
poupoul2
First Cup of Ubuntu
 
Join Date: Mar 2007
Beans: 2
Re: Samsung drivers changing rights

I just sent a email to Samsung to inform them about this problem and ask for an urgent fix

Last edited by poupoul2; July 14th, 2007 at 10:15 AM..
poupoul2 is offline  
Old July 17th, 2007   #4
shyster.
First Cup of Ubuntu
 
Join Date: Apr 2006
Beans: 10
Re: Samsung drivers changing rights

This is great "/. So now that I've installed this POS driver, how do I reverse the changes that it's made? I've made /etc/ belong to root as it should, but I have no idea what to do to fix the other applications. If anyone has a solution that would be great.

EDIT: I've also now uninstalled the unified driver, but it doesn't seem to help.

EDIT 2: Actually I looked over the code in the uninstall script and it seems to unwrap the applications- whatever that means. As follows:

Quote:
check_related_packages
if [ "$TOTAL_RELATED_PACKAGES_INSTALLED" = "1" ]; then
# The last from the group of related packages. Remove common files.
unwrap_setuid_third_party_application xsane
unwrap_setuid_third_party_application xscanimage

wrap_setuid_ooo_application soffice un
wrap_setuid_ooo_application swriter un
wrap_setuid_ooo_application simpress un
wrap_setuid_ooo_application scalc un

uninstall_common_files
However, I'm not sure if this completely reverses the changes made in the first place.

Last edited by shyster.; July 17th, 2007 at 04:22 PM.. Reason: New Information
shyster. is offline  
Old July 18th, 2007   #5
tweedledee
Quad Shot of Ubuntu
 
Join Date: Dec 2006
Beans: 449
Re: Samsung drivers changing rights

This is hardly news. My guide to installing the driver from 7 months ago makes note of this (http://ubuntuforums.org/showthread.php?t=341621). Simply reading the code for the installer is also highly misleading: the installer does not (at least in most cases) actually set anything other than xsane (not openoffice or xscanimage - the latter isn't even on my system, though). Perhaps they intend to, or it is left over from something older, but this is overblown.

Don't get me wrong - I still think this is a problem that needs to be fixed. It's just not as bad as being claimed, especially over on slashdot, where there are many comments by people who have no idea what they are talking about.

As for WHY: the Samsung multifunction printers apparently require some sort of root access for scanning, hence xsane being set to run as root. They should fix their driver to avoid this, but that's what causing it. If you are just installing a printer, you can follow my guide and undo this change with no harm.

I'm not clear on why /etc (and /usr, /etc/sane.d/, /usr/lib/, /usr/lib/sane/, and various others) are being set to the user instead of root; I'm modifying my original install scrip to reset all of this as well, but the files within those directories are all still root, so from a security standpoint this isn't actually that big a deal.
tweedledee is offline  
Old July 18th, 2007   #6
mwarfield
First Cup of Ubuntu
 
Join Date: Jul 2007
Beans: 1
Red face Re: Samsung drivers changing rights

Excuse me?

"but the files within those directories are all still root, so from a security standpoint this isn't actually that big a deal."...

User...

cd /etc
mv shadow shadow-
cp ~/my-shadow shadow
chmod 400 shadow
su
mv shadow- shadow

Or maybe modify your group membership to include wheel or bin or disk or kmem and go after other files/devices with that group in common. etc etc etc...

QED

A user that owns the directory may rename or remove files in that directory and then may create their own (unless the directory permissions are "sticky", like /tmp). Yes, this is a very big deal security wise.

The original complainent was also noting that their OpenOffice files were owned by root, so, yes, OpenOffice was running as root. IOW, the security integrity of entire machine is locally compromised. How is that overblown?

Samsung has acknowledged the problem and is reportedly working on a fix.

How is it that this was known 7 months ago and was NOT reported as a serious security hole?
mwarfield is offline  
Old July 18th, 2007   #7
Silver Surfer
First Cup of Ubuntu
 
Silver Surfer's Avatar
 
Join Date: Oct 2005
Location: Irvine, CA
My beans are hidden!
Ubuntu 7.04 Feisty Fawn
Re: Samsung drivers changing rights

I was wondering why xsane was suddenly giving me the "You try to run XSane as ROOT, that really is DANGEROUS" window when trying to scan things. Now I know why. Didn't use to do that until I installed my CLP-510 printer. Wonder why a company like Samsung would do something that irresponsible.
__________________
Play Awakened Lands. Fun crime for everyone!

Last edited by Silver Surfer; July 18th, 2007 at 01:06 PM.. Reason: Spelling
Silver Surfer is offline  
Old July 19th, 2007   #8
tweedledee
Quad Shot of Ubuntu
 
Join Date: Dec 2006
Beans: 449
Re: Samsung drivers changing rights

Quote:
Originally Posted by mwarfield View Post
Excuse me?

"but the files within those directories are all still root, so from a security standpoint this isn't actually that big a deal."...

User...

cd /etc
mv shadow shadow-
cp ~/my-shadow shadow
chmod 400 shadow
su
mv shadow- shadow

Or maybe modify your group membership to include wheel or bin or disk or kmem and go after other files/devices with that group in common. etc etc etc...

QED

A user that owns the directory may rename or remove files in that directory and then may create their own (unless the directory permissions are "sticky", like /tmp). Yes, this is a very big deal security wise.
This actually illustrates a universal problem with Linux permissions: directory permissions override file permissions (i.e., if I own the directory, I can delete files that I do not own within that directory). Certainly Samsung exposes this problem, but it's more fundamental than that. SELinux addresses this problem somewhat, but isn't running in Ubuntu by default.

Quote:
The original complainent was also noting that their OpenOffice files were owned by root, so, yes, OpenOffice was running as root. IOW, the security integrity of entire machine is locally compromised. How is that overblown?
There must be some locale issues, then - perhaps OO is set to as root in French, but not in my system, or various others I've checked.

Quote:
Samsung has acknowledged the problem and is reportedly working on a fix.

How is it that this was known 7 months ago and was NOT reported as a serious security hole?
Actually, this WAS reported, multiple times. Samsung doesn't care, despite anything they publicly post. (Do you really think the developers didn't know what they were doing?) And the response I got from the Linux community boiled down to "it's closed source, just don't use it," even though the major problem is that one SUID command can have extensive repurcussions, which is really a problem with Linux permissions design (to which the typical response is "don't use SUID").
tweedledee is offline  
Old July 19th, 2007   #9
margaf77
5 Cups of Ubuntu
 
Join Date: Jun 2007
Beans: 41
Re: Samsung drivers changing rights

So how do I uninstall the Samsung driver?
margaf77 is offline  
Old July 19th, 2007   #10
shyster.
First Cup of Ubuntu
 
Join Date: Apr 2006
Beans: 10
Re: Samsung drivers changing rights

Quote:
Originally Posted by margaf77 View Post
So how do I uninstall the Samsung driver?
There's an uninstall script in the tar that you can execute- run it just as you did using the install script and you should be good to go!
shyster. is offline  
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:41 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry