Slashdot Mirror


Some Linux Distros Found Vulnerable By Default

TuringTest writes "Security Focus carries an article about a security compromise found on several major distros due to bad default settings in the Linux kernel. 'It's a sad day when an ancient fork bomb attack can still take down most of the latest Linux distributions', says the writer. The attack was performed by spawning lots of processes from a normal user shell. Is interesting to note that Debian was not among the distros that fell to the attack. The writer also praises the OpenBSD policy of Secure by Default."

44 of 541 comments (clear)

  1. Fork vulnerability by madaxe42 · · Score: 5, Funny

    Kittens are vulnerable to forks by default as well - you can easily get at the kernel if you just - oh, hang on, a different kind of fork, you say?

  2. Thank god I use Windows by Anonymous Coward · · Score: 5, Funny

    Thank god I use Windows, I'm safe!

    1. Re:Thank god I use Windows by rokzy · · Score: 5, Funny

      only if you're running XP Starter Edition!

    2. Re:Thank god I use Windows by LiquidCoooled · · Score: 5, Funny

      No, with XP starter, you are restricted to running only 3 trojans at once.

      --
      liqbase :: faster than paper
    3. Re:Thank god I use Windows by anakin357 · · Score: 5, Funny
      No, with XP starter, you are restricted to running only 3 trojans at once.

      Possible obvious responses:

      Only 3 trojans? I'm a self-replicating-trojan author you insensitive clod.

      So I can only run three instances of Internet Explorer at once?

      Customer: Whenever I try to start a second program, it gives me an error...
      Techie: Yeah, you can't run Gator, Precision Time, Weatherbug AND something else... you've gotta turn something off.
      Customer: (incredulous)WHAT!!?? I NEED TO KNOW WHAT TIME IT IS, SAVE MY PASSWORDS, AND KNOW WHAT THE WEATHER IS LIKE OUTSIDE.
      Techie: (mutes customer): "Fucking Chuck Noris, all those goddamn ninjas had to go after the pirates."

      --
      http://www.fsckin.com/
    4. Re:Thank god I use Windows by soconnor99 · · Score: 5, Informative

      You can put a hundred kill.bat's in there but they never get called. It will transfer control, you need to use "call kill.bat" if you want to continue in the same script.

  3. Sheesh, it's a fork bomb by gowen · · Score: 4, Insightful

    Sorry but the ability for a non-privileged user to run as many programs as the like is a feature, not a bug. Inability to turn that feature off would be a bug, but given that few modern Linux boxes are actually used as multi-user remote-login accounts, it's a completely unecessary overhead.

    And if you are administrating a true multi-user old-style-Unix type server, you should know enough to stop people fork bombing you (i.e. quotas).

    --
    Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    1. Re:Sheesh, it's a fork bomb by gowen · · Score: 4, Informative

      Sorry, brain fart. I meant hard ulimits

      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    2. Re:Sheesh, it's a fork bomb by CaymanIslandCarpedie · · Score: 4, Insightful

      Sounds much like the same reasoning MS used to use for having defaults set to a "user-friendly" setting.

      Now that its been found in Linux, its a "feature" ;-)

      Come on, I love Linux but the hypocrocy is a bit much ;-) Its OK to admit it was bad or admit MS's settings were OK, but you cannot do both.

      --
      "reality has a well-known liberal bias" - Steven Colbert
    3. Re:Sheesh, it's a fork bomb by kfg · · Score: 4, Insightful

      Sorry but the ability for a non-privileged user to run as many programs as the like is a feature, not a bug.

      Sorry, but the ability of a mail reader to automagically run as many programs as it likes is a feature, not a bug.

      The point being that while this may, in some rare cases, be desirable, it shouldn't be the default setting, but rather something that the adminstrator has to enable for that rare user for which it is deemed both necessary and desirable.

      "Able" and "capable of" are not the same thing.

      It shouldn't be the responsibility of the admin to turn on every possible security feature, but rather to turn off only those ones he deems gets in the way of the functioning of his system.

      It's exactly this lacadasical approach to security that has made Windows the hell hole that it is. It certainly puts money in my pocket trying to fix it all, over and over and over again, but I'd far rather be spending my time and earning my money doing something useful.

      Like computing.

      KFG

    4. Re:Sheesh, it's a fork bomb by Xugumad · · Score: 4, Interesting

      And if you are administrating a true multi-user old-style-Unix type server, you should know enough to stop people fork bombing you (i.e. quotas).

      *shuffles nervously* So, out of curiousity, for my.. . err... desktop... how do I stop this exactly? :)

    5. Re:Sheesh, it's a fork bomb by gowen · · Score: 5, Informative

      man ulimit

      Specifically ulimit -H -u <number> in their startup file.

      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    6. Re:Sheesh, it's a fork bomb by Mad+Merlin · · Score: 4, Insightful

      You can set hard limits on the amount of RAM a user may consume, in addition to how many processes they can spawn, as well as a number of other useful things with a trivial amount of effort in Linux, have a look at /etc/security/limits.conf.

  4. Grep Bomb by cheezemonkhai · · Score: 5, Interesting


    So what would a good limit to the number of processes spawned be?

    I mean what can say what is good for everyone?

    Saying that if you think the fork bomb is good grep bombs are more fun and particularly good for silincing the mass of Quake 3 players in an undergraduate lab:

    'grep foo /dev/zero &' fun about 5 of them and watch the box grind to a screaming halt then eventually recover.

    Oh hang on did i just discover a new exploit :P

  5. Not your usual vulnerability by David's+Boy+Toy · · Score: 5, Informative

    Fork bombs only work if you can log into the system in question. This is a bit lower priority than your usual vulnerabilities which allow outside attacks.

  6. Retarded by 0123456 · · Score: 4, Interesting

    Sorry, but this article seems pretty retarded to me. Windows is insecure because people can use IE bugs to install scumware that takes over your entire machine... Linux is insecure because ordinary users who are legitimately logged into your machine can fork off as many processes as they want? Huh?

    Sure, maybe if you're running a server that allows remote logins, you want to restrict how many processes a user can run. But as a single-user system, I want to be able to run as many processes as I choose, not be restricted by the distribution author's ideas of what's good for me.

    1. Re:Retarded by phasm42 · · Score: 4, Informative

      If you had read the article, you'd have realized that this was not Windows vs Linux. It was a report on how a fork bomb can take down default Linux installs, but not default BSD installs. Also, the article was clearly not concerned about single-user installs, but multi-user. Or if the box is hacked into, this is an extra bit of protection.

      --
      "No one likes working in a hamster wheel, and your shop smells of cedar shavings from here." - TaleSpinner
    2. Re:Retarded by Alioth · · Score: 4, Insightful

      *Any* local exploit is *also* a potential remote exploit (just like the IRC conversation shows). I had someone nearly pwn a box of mine by using an exploit in a buggy PHP script, then trying to elevate privileges through a local exploit.

      Had I not considered local exploits important, I'd have had one nicely hacked box.

    3. Re:Retarded by phasm42 · · Score: 4, Insightful

      Two things: 1. Just because you don't care doesn't mean other people won't care. A lot of people (especially in a business environment) do have more than one person logging. 2. The article is trying to point out something that Linux installs could improve on. That is all.

      --
      "No one likes working in a hamster wheel, and your shop smells of cedar shavings from here." - TaleSpinner
  7. Debian not vulnerable? by lintux · · Score: 5, Interesting

    I really wonder what kind of Debian installation he runs. Just a couple of weeks ago I had to reboot my Debian box after some experimenting with an obfuscated fork bomb. Won't work again now that I set some ulimits, but they're not there by default.

    In case anyone is interested, here's the obfuscated fork bomb: :(){ :&:;};:

  8. Not a vulnerability. by argent · · Score: 5, Insightful

    A forkbomb is just a relatively simplistic way to mount a resource exhaustion attack. I would be extremely wary of anyone who claims that their UNIX class operating system is immune to resource exhaustion from a local user. There's just too many resources that can be commandeered, and to lock them all down would leave you with a system that's so restricted as to be nearly useless as a general computing platform.

    It must be a slow day on /. if they're reporting this as news.

  9. Re:In other news... by oscartheduck · · Score: 5, Insightful

    No, I understand the article. I just couldn't resist the jab. The fact is that GNU/Linux ought to be the best it can be in and of itself. That some distributions are screwing that up and making very poor defaults is not to be forgiven. Not at all. Especially when it isn't difficult to do better.

    --
    How to use coral cache: http://slashdot.org.nyud.net:8090/~oscartheduck
  10. And of course, shell access is so easy to get by n0dalus · · Score: 5, Insightful

    On the 3 distros listed as vulnerable, the default settings would stop any remote person from having a chance of getting a shell open on the box to perform the fork attack in the first place.
    If a person has enough access to the machine to be able to "forkbomb" it, then there's plenty of other nasty things you could do to it.

  11. New Plug Vulnerability found! by Anonymous Coward · · Score: 5, Funny

    Unprivileged user can take down entire system by unplugging machine from power socket.

  12. Wrong attitude. by Anonymous Coward · · Score: 5, Insightful

    All my servers have multiple users. Those users are system accounts to run different software, and I do not want any of them to be able to cause a problem to the entire server. Reasonable limits should be in place by default, and those of us who actually need higher limits for certain users, can raise those limits.

    Even on a single user desktop machine, its nice to have limits so shitty software can't take down my entire machine. With limits I can just log in on another terminal and kill the offending program, without limits you get to reboot, and lose any work you were doing.

  13. Running bash then :p by cheezemonkhai · · Score: 4, Informative

    You were running bash then :p

    I recognise that one... which is always good :)
    just don't leave your box unlocked and have some "funny" person drop it in your .login or .bash_rc files.

  14. My God, the hypocracy! by drsmack1 · · Score: 5, Insightful

    Looks like everyone out there on slashdot think this is not really a problem. Remember when it was discovered that you could get into a xp installation locally with a win 2000 boot cd? Oh, the howling that was heard.

    Here is a issue that can be done remotely with only a user account.

  15. Reminds me of DoS: Pingfork! by nullset · · Score: 4, Interesting

    I came up with the idea of a ping/fork DoS attack (mostly as a joke)

    In pseudocode:
    while (true) {
    ping(target)
    fork()
    }

    I seriously thought of posting this to a few script kiddie sites, so the kiddies could crash themselves long before the pinging does any damage :)

    --buddy

    1. Re:Reminds me of DoS: Pingfork! by caluml · · Score: 5, Funny
      I seriously thought of posting this to a few script kiddie sites

      ...and now you have :)

  16. Isn't it friggin' ironic by aendeuryu · · Score: 5, Insightful

    It's funny, isn't it, that on the same day we have a story about Linux distros being insecure by default, EXCEPT Debian, we have another story where Debian is being criticized for not releasing updates more often.

    Maybe, and here's a thought, just maybe, it's wise to take a decent, stable distro and perfect it, instead of taking a distro and submerging it in a state of perpetual flux with constant updates.

    Just a thought. I might be biased because it's a Debian-based distro that finally put a working Linux on my laptop. But you know what? Every now and then the bias is there for a reason...

  17. Silly exploit by SmallFurryCreature · · Score: 4, Insightful
    As others have already commented this has little to do with security.

    Most linux systems are used as desktops, if you use them as a server you don't use the defaults. Now a user being able to crash his own system is nothing new. It ain't nice but as long as it is the user doing it then no problem. Now if this fork could be used to make apache explode and bring down the system THAT would be a boo boo.

    Ideally yes the system should not do things that bring it coming crashing down but this is close to blaming a car for allowing me to plow into a wall. Not sure if I want a car/computer telling me what I can and cannot do.

    As to how to set the limits on the number of forks. Maybe I got this completly wrong but could it be that this depends entirely on your hardware? Perhaps the latest IBM mainframe can handle a few more then an ancient 386? How the hell is the distro supposed to know what I got?

    Security is other people doing stuff on my computer that I don't want and or know about. Me screwing stuff up is my business.

    BSD is very solid, this is known. It is also known that BSD has been along long before linux and but has been sucking it exhaust fumes ever since it arrived. For every story about how much more secure BSD is there are a dozen stories about linux actually making a mark on the world. So good. Your BSD survived a forkbomb. But why exactly was the author running a linux desktop then if BSD is so much better?

    Another non-story on /. Is the internet going to the way of tv?

    --

    MMO Quests are like orgasms:

    You may solo them, I prefer them in a group.

  18. Re:Grep Bomb (try it in freebsd) by keepper · · Score: 4, Informative

    A good vm should do enough accoutning to allow you to log back in and kill those.

    So, try this in FreeBSD, and be amazed, now try it in any 2.4 or 2.6 linux kernel, and be disgusted.

  19. Re:another way to bring a system to it's knees by tlhIngan · · Score: 5, Informative

    while(1) { malloc(1); }

    That won't work on modern systems, or systems with a lot of virtual memory available (lots of RAM or large swap).

    A modern OS will not actually commit memory until it is actually used, and while malloc() involves some bookkeeping, most of the bookkeeping is very little. It's quite likely you'll actually run out of process RAM (2GB or 3GB, depending on settings on a 32 bit machine) space first before the system starts to strain. On Linux, the recent kernels will kill processes that start hogging RAM when free memory falls below the low-water mark. And each malloc() really allocates 8/16/32 bytes of RAM for even a 1 byte allocation.

  20. Default kenerl in Gentoo? by olympus_coder · · Score: 5, Informative

    Unless you use genkernel, there is NO default kerenel configuration, verions or anything else. No serious admin uses genkerenel as anything other than a starting point - PERIOD.

    Choose your kernel version, patch set, etc. No defaults. I guess he has never actually installed gentoo himself. The author should get a clue about the distro's he's talking about before making clames about their security.

    --
    Spell check? Why bother. That is what grammer/spelling Nazi freaks who waiste band width posting "spell right" are for.
  21. I remember forkbombing myself by gosand · · Score: 4, Interesting
    I was working at my first job, and we had 10 people to a Sun server. I was writing shell scripts, and wrote one called fubar that was this:

    while [1] do
    fubar &
    done

    Then I did chmod +x fubar, and typed "fubar &"

    oops.
    The system load started climbing and everyone else on the machine started bitching. I thought it would crash, and went over to the local admin and fessed up. Of course, we were all interested in what would happen. Nobody could get in to kill it, and the processes were spawning so fast that we couldn't catch it. It was taking forever just to log int. But the load leveled off, and it wasn't going to crash. The admin was going to reboot it, but then I said "wait a second!" I went back to my window that was open. Know what I typed?

    rm -f fubar

    I suppose you could make it more nasty by making the file name create a copy of itself and name it the process id, so that you wouldn't be able to rename it.

    cp $0 .$$
    ./.$$ &

    This will leave all the process files laying around, but you could code something to remove them. But this gets the point across.

    --

    My beliefs do not require that you agree with them.

  22. Not worth the risk. by Mr.+Underbridge · · Score: 4, Insightful
    Sorry but the ability for a non-privileged user to run as many programs as the like is a feature, not a bug. Inability to turn that feature off would be a bug, but given that few modern Linux boxes are actually used as multi-user remote-login accounts, it's a completely unecessary overhead.

    Right, it's a feature, but the question isn't whether it should ever be allowed, but what the default setting should be. I think the article made a pretty good case that default should be no.

    And if you are administrating a true multi-user old-style-Unix type server, you should know enough to stop people fork bombing you (i.e. quotas).

    First, I think a lot of unix people would be shocked to find that's on by default as the writer was. Second, that basically means that anyone who successfully hacks into a user account takes the machine down. That applies for your desktop machine, not just "old-style" unix type servers. Third, you mention the relative scarcity of old style servers these days - they're still more common than a user who needs to run an INFINITE number of programs. Even capping somewhere in the thousands would work, keeping anyone from being hampered in their work.

    Basically, this is a case of idea vs. reality. You want the IDEA that you can run as many programs as you want, though you'll never need to. So in REALITY, a sane cap never hurts you. However, a lack of a cap provides very REAL security problems, either from a user or from someone who manages to hack a user account. Again, you really don't want EVERY userland exploit to lead to a kernel takedown, do you?

  23. Re:In other news... by tomhudson · · Score: 5, Informative
    The Windows holes aren't in the FRIGGING KERNEL.
    Neither are the "holes" the article talks about.

    If you had bothered to read the thread the article points to, the forkbomb vulnerability wasn't in the kernel per se, but in the /etc/security/limits file, which on most distros has a bunch of example lines commented out by default.

    The kernel can't/shouldn't implement limits that are commented out.
    Edit the file(s) to your taste and reboot.
    No kernel patching necessary.

  24. Re:In other news... by Flying+Purple+Wombat · · Score: 4, Informative

    On my Win2k box, running ":(){ :|:& };:" at a Cygwin bash prompt DOES kill the system. I don't know enough about Windows admin (and I don't care enough to learn) what would prevent a forkbomb.

    --
    If God had meant for man to see the sunrise, He would have scheduled it later in the day.
  25. We're talking DEFAULTS by Stephen+Samuel · · Score: 4, Insightful
    Sorry but the ability for a non-privileged user to run as many programs as the like is a feature, not a bug.

    Just how many regular users expect to run 20000 processes at once? (or even 200?) When that happens it's almost always caused by a bug (or malicious activity). Right now, I have 50 user processes running. I'm a power user, but I'd probably never get blocked by a limit of 1000 unless I was doing something really wierd -- and something that weird should come with instructions on modifying the kernel settings.

    Yes, it should always remain possible to set up your system so that you can run massive numbers of processes and/or threads, but the default should be to keep numbers to a dull roar in favour of system stability. People whose needs are such that they actually and legitimately want to fork massive numbers of processes are also the kinds of people who wouldn't have a hard time figuring out how to change the kernel settings to allow it.

    As such, the default should err on the side of security, but allow a knowledgable user to do whatever the heck he wants.

    Thing is, though, that local resource-exhaustion exploits are difficult to set. You want to allow a user felatively free reign -- even to the point of stressing the system, but still allow enough of a reserve so that an admin cam login and shut down a user who'se gone overboard. You also want to set a limit that will be reasonable 5 years down the road when processors are 10 times as fast (and/or 20-way SMP is standard issue)

    Something to note here in Linux's favour: Even though the forkbomb brought the system to it's knees it stayed up. Although it might have taken 1/2hour to do, an admin may have been actually able to login and kill the offending process.

    --
    Free Software: Like love, it grows best when given away.
  26. Re:"Secure By Default"? by ArbitraryConstant · · Score: 4, Interesting

    Please explain how the ftpd binary (not suid) can be used to exploit the system in ways that the user otherwise could not.

    Taking away the ftpd binary wouldn't stop the user from doing exactly the same thing by some other means. For example, they could simply download the source and compile a new one by themselves. Or use Perl. Or compile a binary somewhere else and download that.

    --
    I rarely criticize things I don't care about.
  27. No, you are treating it as a panacea. by Anonymous Coward · · Score: 5, Insightful

    We aren't saying that default limits will be perfect for everyone. We are saying that its better to have to raise your limits IF YOU NEED TO, then to have your machine vulnerable to being completely taken down trivially, very possibly by remote users with no accounts, just from making your services work harder than you expected.

    If you are running a server than needs hundreds of apache processes running, then you know that and can raise it. Someone who is new to linux won't need that, and won't know how to setup limits for themselves. So you make the machine secure by default, and allowed advanced users with advanced needs to tweak things as they need.

    The best thing I can think of to illustrate the point to you is your apache example. By default apache won't let you have more than 150 users connected. This is a sane default to protect from resource exhaustion. If you need more than that, you can set it yourself. People have some protection by default, but advanced users can customize the settings for their needs.

    I cannot believe in 2005 I am arguing with someone who thinks secure by default is a bad idea because it might invonvenience you.

  28. Linux ignored a lot of rlimits until recently? by wsanders · · Score: 4, Interesting

    In the past I've been awakened in the dead of night by my IDS'es detecting a fork bomb and it's always been self inflicted - some dumbass^H^H^H^H^H^H^Hmisinformed programmer not understanding why it's important to check the return status of a fork() or set alarms to kill off hung sockets.

    I found some earlier kernels ignored RLIMIT_CPU, RLIMIT_RSS, and RLIMIT_NPROC, and setting the CPU and RSS limits in Apache was ineffective. This was in the Red Hat 9 / 2.4.20 kernel days. I have not researched this in a year or so. If all this stuff works now, let me know so I can insert a "ulimit -Hu 10" in future startup scripts as a "courtesy" to inattentive programmers.

    --
    Give a man a fish and you have fed him for today. Teach a man to fish, and he'll say "WHERE'S MY FISH, YOU IDIOT?"
  29. Speaking of insecure.... by JohnTheFisherman · · Score: 4, Funny

    Many Linux users found to be insecure whenever the faults in their OS are pointed out. ;)

  30. Re:Yawn. by Taxman415a · · Score: 4, Insightful

    This level of fanboyness is unbelievable. Well actually I should not be surprised, blindness to linux's faults is endemic here on Slashdot.

    The author is not "Running around screaming...", he is simply very surprised that a local user can exhaust a system so easily. Maybe every single admin should think of all n possible security problems every single time they take a box live, but people are human.

    Which one is worse: limits in place by default so that an admin needs to know how to raise them when necessary and the forkbomb would not work, or no limits in place and having to know to set them or else the box can be brought to its knees? Secure by default or free for all.

    I suppose you think every default install should also have telnetd enabled by default because any admin with half a brain should know how to turn that off? Point is admins are fallible, the default should be the lower total risk/cost option. I think which one that is is clear here.