Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Security Bug Software Linux

Major Security Hole In Samsung Linux Drivers 295

GerbilSoft writes with news of a major security hole in Samsung's proprietary Linux printer drivers. From the Ubuntu Forums: "Just to inform you about a recent post on the French Ubuntu forum about Samsung drivers (sorry, in French). [Google translation here.] 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." GerbilSoft adds: "Among the programs that it sets as setuid-root are OpenOffice, xsane, and xscanimage."
This discussion has been archived. No new comments can be posted.

Major Security Hole In Samsung Linux Drivers

Comments Filter:
  • suid is evil! (Score:2, Informative)

    by PetriBORG ( 518266 ) on Wednesday July 18, 2007 @08:01AM (#19899017) Homepage
    Once more boys and girls, say it with me now, SUID IS EVIL! :-)
    Nothing but the programs that absolutely have to should be run as root.

    Is there an English (not some auto-translated forum) site covering this? I think its talking about this suid run printer driver [openprinting.org]?

  • by Xiph ( 723935 ) on Wednesday July 18, 2007 @08:06AM (#19899069)
    It's a driver installation, so the ordinary user doesn't/can't do it.

    However, it's a proprietary driver, that you need to install to use the printer, so if that's the printer you have people install it, expecting it not to create security holes.
    This might have been discovered earlier, if it weren't for the closedness of the source.

    My guess is that it happened due to a coder writing the driver so, it requires root to use it.
    Then trying to guess which programs requires the driver, then setting those to run as root. Silly, but easy to do.

    Sounds like it was done without peer review, so i guess they only have one guy writing their linux drivers..
    So why is it proprietary? well some places printers are encouraged(required) by law (enforcement) to leave secret and invisible watermarks.
    If it isn't done in the printer, it's done in the driver, if it's open, it'll be removed.
  • Re:suid is evil! (Score:5, Informative)

    by nagora ( 177841 ) on Wednesday July 18, 2007 @08:13AM (#19899121)
    Once more boys and girls, say it with me now, SUID IS EVIL! :-)

    SUID does not have to set id to root; my printing scripts are all setuid to "lp"; my mail servers are suid to "mail". This is a good thing.

    TWW

  • It come out... (Score:5, Informative)

    by dmayle ( 200765 ) on Wednesday July 18, 2007 @08:15AM (#19899143) Homepage Journal

    For those who can't read French, the Ubuntu forum is just a posting of a link to another forum where it was noticed. The posting, along with the interesting source can be found at http://linuxfr.org/forums/15/22562.html [linuxfr.org] The interesting parts are:

    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

    The script copies the affected application's executable to one with a .bin extension, and replaces it with an suid wrapper script. This is undoable, but god, what a mess!

    Okay, I couldn't overcome the lameness filter, go to the source to see for yourselves...

  • Flawed Design... (Score:2, Informative)

    by krischik ( 781389 ) <krischik&users,sourceforge,net> on Wednesday July 18, 2007 @08:29AM (#19899229) Homepage Journal
    Only when the little bugger of an hotplug-manager changes the user id for the scanner device to the logged on user. Which still only gives one user access to the scanner. Have my Wife remote logged in and only one of us can use the scanner.

    Unix security if just flawed and the flaw is called "root".

    Martin
  • Re:Flawed Design... (Score:2, Informative)

    by Anonymous Coward on Wednesday July 18, 2007 @08:37AM (#19899307)
    Maybe you should turn off the hotplug manager, or reconfigure it so it doesn't manage your scanner device? Why not set the scanner device to be owned by a group consisting of yourself and your wife? Then you could both use it, and neither of you would need to be root, and you wouldn't need any setuid binaries.
  • by MrNemesis ( 587188 ) on Wednesday July 18, 2007 @08:41AM (#19899355) Homepage Journal
    If you allow the local user to install programs, then the local user is either;
    a) going to need write access to all the usual locations (either /usr/bin and /usr/lib, or /opt) which wouldn't solve the problem TFA is on about
    b) going to need to use some middleware that *does* have rwx access to /usr and a fine grained ACL system dictacting which users have access to what

    "Driver" installs just need access to /lib.

    Fact of the matter is that whatever user/process has the rights to install apps has the rights to fuck them up as well. Much like how windows can't help it if the user runs trojan_setup.exe.

    As ther other poster noticed, things like SELinux offer incredibly fine grained access over what various users can and can't do, and if you go through the (fairly considerable) pain of setting it up it can give you an amazingly secure setup, but there's no way in hell it'd fly with everyday users or even most sysadmins. This is why Linux distros take such care with package management and like to retain control over their repositories - because they can't risk a third party, closed source package coming in and accidentally running a chmod -R 777 / on install. When you're dealing with companies that seemingly have little knowledge of Linux development and security models, this is a very real threat.
  • Re:Flawed Design... (Score:5, Informative)

    by morgan_greywolf ( 835522 ) on Wednesday July 18, 2007 @08:42AM (#19899359) Homepage Journal
    I'm going to reply to your post backwards, but you'll see why.

    Unix security if just flawed and the flaw is called "root".


    There is a fix for this flaw. It's called 'groups.'

    Only when the little bugger of an hotplug-manager changes the user id for the scanner device to the logged on user. Which still only gives one user access to the scanner. Have my Wife remote logged in and only one of us can use the scanner.


    This is distro-dependant. On Ubuntu, scanner access is controlled by groups. Want a user to be able to scan? You add them to the scanner group. You want someone to have access to burn CDs/DVDs? You add them to the cdrom group. If the scanner device is owned by any user, and owned by the group scanner, the permissions on the scanning device are set to group read/write, and both you and your wife are in the scanner group, then you both have access to the scanner. Try it yourself. Problem solved.

    BTW--with SANE, the best way to have two people access the same scanner is via the saned network sharing mechanism, which allows other systems using xsane (or other sane front-end) to access the scanner over the network without having to remote login.
  • by VE3OGG ( 1034632 ) <VE3OGG&rac,ca> on Wednesday July 18, 2007 @08:45AM (#19899377)
    Hello,

    After I installed the unified drivers for my Samsung printer/scanner, I had the unwelcome surprise of discovering that OpenOffice now opens as root, and not only that but did not ask for my password!

    As a result, all documents I created were saved in the /root/ directory with super user rights. Practical and super secure!

    I attempted to re-install .Xauthority without success.

    The beast (the problem) is occuring under Ubuntu 7.04 under Gnome.

    Thank You.

    Bonjour,

    Après avoir installé les drivers unifiés de Samsung pour gérer mon imprimante scanner, j'ai eu la très mauvaise surprise de constater que la suite openoffice s'ouvrait en root et ceci sans que me soit demandé le moindre mot de passe !!!

    Du coup, les documents que je crée s'enregistrent dans le dossier /root/ avec des droits de super utilisateur. Pratique et super sécure !

    A tout hasard j'ai réinitialisé le .Xauthority : aucun succès.

    La bête est sous Ubuntu 7.04 et gnome. En attendant vote aide, je cherche et tente de résister au désespoir le plus sombre !

    Merci
  • by Jerry ( 6400 ) on Wednesday July 18, 2007 @08:58AM (#19899535)
    Here is a posting to the Ubuntu forum that is SEVEN MONTHS old and refers to postings A YEAR OLD!

    Printer drivers need to be installed with world execute permissions so that all users on the system can access the printer. The Samsung hacker's method of doing this, converting them to 4755 bin files and setting the original name as a link to the bin files, is one way of doing that -- IF his "unwrap" function had worked properly. That's the bug. Listed in the posting are files whose permissions need to be modified after the driver is installed.

    #1
    Old January 18th, 2007
    tweedledee tweedledee is online now
    Way Too Much Ubuntu

    Join Date: Dec 2006
    Beans: 252
    Ubuntu 7.04 Feisty Fawn User
    HOWTO Install Samsung Unified Printer Driver
    I had a fair amount of trouble initially getting my Samsung printer installed completely, but I finally have it all done, so here's a mini-guide for those who might benefit.

    NOTE: for the last few months, the Samsung website has been utilizing some buggy Flash code that will crash many (all?) Linux browsers that have Flash installed - hopefully they will fix this soon, but they don't seem in any hurry. Either use a secondary browser that does not have the Flash plugin installed (e.g., if you mainly use Firefox, you could use Epiphany (Gnome) or Konqueror (KDE)) or download the drivers via another computer/OS. Alternatively, again if you use Firefox, you can install the "flashblock" extension, usually this prevents the crash (and is useful for many of the other websites that have been appearing recently causing the same behavior, although it's not 100% successful).

    EDIT: The newest (as of this writing) driver from Samsung (20070324...) appears to solve some of the mfp/xsane issues, but also appears to missing a couple of library files. See post #23 for details. Also see posts #27-29 for details on ...plc errors and solutions.
    Post #35 suggets the 200704.... drivers have resolved this issue, so this may now be irrelevant.

    First, a disclaimer: much of the information I used came from this thread: http://www.ubuntuforums.org/showthread.php?t=28774 7 [ubuntuforums.org]. Another good source of information is http://www.linuxprinting.org./ [www.linuxprinting.org] Finally, I did this using the 20060719... and 20070125.... drivers; newer (or older) drivers may require some tweaks. Also, especially if you have a monochrome, non-duplexing, non-multifunction printer, you very well may have success with a generic post-script printer as a driver, without having to install the Samsung drivers. Also note that for my printer, pretty much all functions except duplex control worked even if I skipped steps 2-4 below (i.e., don't install the driver, only the relevant .ppd file) - which also has the advantage of not needing to fix xsane (additional step 2).

    This works for my CLP-550; similar steps seem to work for other Samsung printers not supported out-of-the-box with the drivers available in a fresh Ubuntu install. This is NOT a multi-function, multi-functions may require additional steps (but are discussed in other threads, a quick search should bring them up). Posts below from other users have reported sucess (sometimes with a couple of small modifications) with: ML-2510 (# 5, 14, 16, 26), ML-2510/XEU (# 18 ), ML-2571n (# 12), SCX-4200 (# 10), SCX-4521F (# 11), CLP-300 (# 35).

    1. Download and untar the driver from Samsung's website; for this example I will assume you untar it to ~.
    2. Open a terminal and navigate to ~/cdroot/Linux. I had to "chmod +w install.sh" to give write permissions, but that may be unusual. Edit install.sh as follows:
    a: change the first line from "#! /bin/sh" to "#! /bin/bash" (without the quotes)
    b (possibly not needed): change the line that includes "guiinstall.bin" (search for it, it's around line 1277) to eliminate the ".bin" (i.e

  • Re:Lazy Design... (Score:4, Informative)

    by B'Trey ( 111263 ) on Wednesday July 18, 2007 @09:01AM (#19899579)
    I can't tell you why the driver did what it did. However, from what I've read, the driver actually moves binaries to new locations and replaces them with a startup script which is set to run suid. That's way, way, way over the line. It breaks lots of stuff, like updates and patches. Someone doesn't deserver to be fired. Someone deserves to be tarred and feathered and banned from ever touching a computer again.
  • Re:Lazy Design... (Score:3, Informative)

    by quanticle ( 843097 ) on Wednesday July 18, 2007 @09:20AM (#19899789) Homepage

    In my opinion, the manager is responsible for the conduct of the employees. Taking responsibility for those working under you is a fundamental part of good leadership. Its the manager's job to check the employee's work to make sure that it meets quality criteria. In this case the manager failed in his or her supervisory duties.

  • by Varka ( 767489 ) on Wednesday July 18, 2007 @09:39AM (#19900011)
    The bug is that the driver actually tries to UN-suid the applications: 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 But they screwed up the oo unwrap part. The "un" should be BEFORE the "wrap" on those lines. It suids the apps temporarily, and improperly un-suids them.
  • by Moraelin ( 679338 ) on Wednesday July 18, 2007 @11:11AM (#19901379) Journal
    I wouldn't be too surprised if something like this was a management decision to start with. Someone figured out they'd save some money on tech support calls, for example, if the users don't have to keep calling with stuff like "why does this ask for a password when I want to change the printer?" and "does your driver have a virus? my grandson said I should beware stuff that asks for a password" (for bonus points: "... and he didn't tell me the password anyway. Can I still use the printer?") and the like. Don't underestimate the kind of dumb decisions that get taken in the name of cost cutting.

    And that includes the fact that it probably wasn't a programmer/architect that made the installer anyway. The drive for cost cutting includes the idea of giving each job to the lowest wage monkey who can possibly do it. So it's not entirely unheard of to offload to the cheapest interns or even to underused non-technical members of the team stuff like making an installer or writing the test cases.

    In which case probably some under-paid and under-skilled monkey got the honour of figuring out how to install that stuff in Linux. These aren't typically the kind of guys you'd ask to do a security analysis and design, and they're not given ample times and funds for research either. So he'll google if he has a problem (like how to make some nice config dialog modify a file that was installed as writable by root only), and take the first thing that sorta looks like a solution.

    Plus a few other such fun ways to fuck up in the name of keeping the costs down.

    Mind you, I'm not saying this has to be what happened at Samsung. Just saying that I've seen that and worse happening in other places, so I wouldn't be too surprised.

And it should be the law: If you use the word `paradigm' without knowing what the dictionary says it means, you go to jail. No exceptions. -- David Jones

Working...