News for hackers. Stuff that matters.
Re:Re: CVE-2014-6271 – remote code execution through bash by plq on Friday September 26, 2014 @04:36AM (#8371862)
And I'd like to thank Gentoo developers for the usual very fast response they had towards this security advisory.

The moment I saw the news here, I ran to update my stuff -- the patch was already there, marked stable in the official gentoo repositories.

My impression is that they're following very closely the progression of this event and the relevant GLSA entries are being updated without any noticeable delays.

Thanks for running the show guys, you're true professionals!

Here's the relevant Gentoo Linux Security Advisory (GLSA) link: http://www.gentoo.org/security/en/glsa/glsa-201409-10.xml

Re:Re: CVE-2014-6271 – remote code execution through bash by jo_ on Friday September 26, 2014 @09:57AM (#8372646)
Same with Ubuntu, which I run on my servers. It was patched by the time I had SSH'd in.
Re:Re: CVE-2014-6271 – remote code execution through bash by nextw33k on Friday September 26, 2014 @07:31AM (#8372260)
This issue is an awesome demonstration of how bad closed ecosystems are. The open systems that are running on Linux (RedHat, ubuntu, etc) are patched and updated.

However, OSX which is also affected is still waiting. If I owned an Apple server I'd be screaming right now.

Embedded devices with closed eco systems are also stuffed (we've got to moved to open router firmware like OpenWRT). Basically, you can carry on as normal if you use open source the way it was intended.

Re:Re: CVE-2014-6271 – remote code execution through bash by acdha on Friday September 26, 2014 @09:31AM (#8372570)
I don't want to defend Apple too much – at various points I spent many months hoping nobody else discovered a MITM exploit before they shipped the next OS release – but this is a near-complete non-issue for an OS X desktop user and even servers have fairly limited exposure.

If you want to beat Apple up, a much better case was goto fail where they left all of the Mac users hanging for a long period of time after shipping the iOS patch and disclosing the vulnerability.

Re:Re: CVE-2014-6271 – remote code execution through bash by Osmium on Friday September 26, 2014 @08:26AM (#8372373)
Devil's advocate: most OS X systems aren't running exposed services that could be exploited, and if you were running an OS X server you can always re-compile bash manually for something of this severity (and Homebrew/MacPorts make this even easier).

That said, I do think it's ridiculous though how slow Apple is. It's absolutely crazy. I can only hope that Heartbleed and now this are causing some major internal reviews over there...

Re:Re: CVE-2014-6271 – remote code execution through bash by shabble on Friday September 26, 2014 @09:27AM (#8372551)
Even though I've got MacPorts bash installed, it lives in /opt/local/bin, while the default one in /bin/{ba,}sh is the ancient apple 3.2 one.

https://apple.stackexchange.com/questions/146849/#146851 has a simple enough step-by-step guide to patching & recompiling the system version with the appropriate patches, if you've got XCode installed and are comfortable with that sort of thing.

Agreed on the Apple security response time though. I reckon they have all their best guys fighting the IOS jailbreakers :P

Re:Re: CVE-2014-6271 – remote code execution through bash by ergzay on Friday September 26, 2014 @10:10AM (#8372705)
You should jump to using Homebrew. It's superior in most ways. I'd used MacPorts and Fink before Homebrew came about and I never much liked either. Homebrew is as simple as it can be and is really good at detecting conflicts which MacPorts and Fink were terrible at.
Re:Re: CVE-2014-6271 – remote code execution through bash by shabble on Friday September 26, 2014 @11:57AM (#8373240)
I've fought with both of them in the past, and ultimately went back to MacPorts when I last reinstalled.

Homebrew was (at the time, maybe a year or so ago) missing a lot of things I wanted to use, and some packages broke for no obvious reason.

I'm sure some of it was the result of my rather frankensteinien setup by that point, but I have no real desire to reinstall things again until I have to.

MacPorts may be occasionally annoying, but at least it's usually in a way have come to understand. :)

Re:Re: CVE-2014-6271 – remote code execution through bash by aroch on Friday September 26, 2014 @09:46AM (#8372612)
How is OSX a closed system in this particular case? You can easily compile bash, with patches, and replace the system binary -- using the same code that's used to build those Debian/Redhat/whatever binary. Its all the same gnu code.

What about all those EOLed distros that don't see most security updates? Being "Open" is a non-issue here.

Re:Re: CVE-2014-6271 – remote code execution through bash by PinguTS on Friday September 26, 2014 @07:48AM (#8372289)
There are many ways to argue this way or that way.

I could argue, that there is a bug for over 20 years in open source and nobody discovered it? WTF? So Windows is better, because it does not has this bug in the first place?

There is no right or wrong. Open Source is not better and not worse. Everything has its place and its purpose.

Regarding those embedded device I can say, they don't use BASH. Because of size constraints they all use Busybox, which does not have this problem, like all those other Shells.

Re:Re: CVE-2014-6271 – remote code execution through bash by cft on Friday September 26, 2014 @01:11AM (#8371438)
This appears to be the same as http://seclists.org/oss-sec/2014/q3/att-690/eol-pushback.pat... at least for 4.3. But for 3.2 http://seclists.org/oss-sec/2014/q3/att-690/eol-pushback.pat... did not work, I had to download bash32-053.bin from Chet's email.

Procedure for Ubuntu 8.04 and other installations where binaries are not available (default 8.04 LTS server did not have m4 and bison dependencies), assuming that 1st patch has already been applied per https://news.ycombinator.com/item?id=8364385 :

  #Executing as root 
  #assume your sources are in /src:
  cd /src/
  echo "getting m4..."
  wget http://ftp.gnu.org/gnu/m4/m4-latest.tar.gz
  tar zxvf m4-latest.tar.gz 
  cd m4-1.4.17/
  ./configure && make && sudo make install
  cd /src/
  echo "getting bison..."
  wget http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
  tar zxvf bison-3.0.tar.gz 
  cd bison-3.0
  ./configure && make && sudo make install
  echo "getting patch..."
  cd /src/
  #replace line below with wget http://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-026 tomorrow
  wget http://seclists.org/oss-sec/2014/q3/att-690/eol-pushback.patch
  cd bash-4.3
  patch -p0 < ../eol-pushback.patch
  ./configure --bindir=/bin && make && sudo make install
Re:Re: CVE-2014-6271 – remote code execution through bash by rbobby on Friday September 26, 2014 @12:56AM (#8371389)
Not having worked with bash (et al) in ages I wonder whether allowing a function definition (even without trailing commands) is not still hole? What if you defined a function 'ls() { evil... }'... could a CGI script making a call to 'ls' actually end up with the function instead of the real 'ls'?
Re:Re: CVE-2014-6271 – remote code execution through bash by ak217 on Friday September 26, 2014 @01:05AM (#8371421)
You can't control the name of the function - that's dictated by the name of the environment variable. The feature at fault is activated by the presence of "(){" at the start of the environment variable value.
Re:Re: CVE-2014-6271 – remote code execution through bash by stormbrew on Friday September 26, 2014 @01:21AM (#8371462)
I think the cases where it's still a hole are probably obscure and/or unlikely in the wild, but I definitely think the response to this should have been to disable the feature altogether. It's a terrible idea and I'm really curious if anything actually uses it and should be using it.
Re:Re: CVE-2014-6271 – remote code execution through bash by philh on Friday September 26, 2014 @05:51AM (#8372017)
It's used to export functions from one instance of bash to a child. Do you think that that's a terrible idea, or do you have a better idea of how to implement it?

(The fix changes it so that exporting is done through specially named variables. Instead of exporting `x='() { :; };`, it now exports `BASH_FUNCTION_x()='() { :; };'`.)

Re:Re: CVE-2014-6271 – remote code execution through bash by stormbrew on Friday September 26, 2014 @11:14AM (#8373034)
Do any other shells do it? Afaik it's not part of the POSIX sh spec. So any script that does it is going to be extremely dependent on bash in particular.

It would take actual use cases to convince me it's not a terrible idea. No matter what it's a mechanism to throw arbitrary code into a script that has no say in it. This is not the sort of thing you should do because it seems cool, it should be the sort of thing you do because of a really compelling use case that necessitates it. The fact that afaik no other shell has implemented this behaviour since bash did (a couple of decades ago if I understand correctly?) would rather suggest there is a lack of need for this.

Re:Re: CVE-2014-6271 – remote code execution through bash by tokenizerrr on Friday September 26, 2014 @01:00AM (#8371398)
Yes, but if you can control enviroment variable names then you can also set LD_PRELOAD and a whole load of other nasty enviroment variables.
Re:Re: CVE-2014-6271 – remote code execution through bash by bodyfour on Friday September 26, 2014 @01:02AM (#8371407)
...although some programs blacklist unsafe environment variable names. They all should be updated to also blacklist bash function values.
Re:Re: CVE-2014-6271 – remote code execution through bash by mh- on Friday September 26, 2014 @01:09AM (#8371431)
fortunately, sudoers(5) (et al.) whitelist certain variables.
Re:Re: CVE-2014-6271 – remote code execution through bash by mrmondo on Friday September 26, 2014 @12:42AM (#8371360)
Debian patched this 8 hours ago, Redhat issued a patch about 3 hours ago, I believe Centos is still vulnerable, Ubuntu 14.10 isn't patched yet, Ubuntu 14.04 was patched about 3 hours ago.
Re:Re: CVE-2014-6271 – remote code execution through bash by psgbg on Friday September 26, 2014 @01:03AM (#8371411)
I'm using debian jessie (testing) i386, and I had to download bash myself (from sid) because my up-to-date system was affected but the first patch was available for sid (unstable) and wheezy (stable) and not in jessie.

So I don't know if every architecture, and version is updated with the same speed.

Re:Re: CVE-2014-6271 – remote code execution through bash by mrmondo on Friday September 26, 2014 @01:26AM (#8371476)
Jessie isn't released / stable and doesn't receive security patches until it is. It's called testing for a reason.
Re:Re: CVE-2014-6271 – remote code execution through bash by bigbugbag on Friday September 26, 2014 @04:12AM (#8371812)
debian testing do receive security patches, but it is not a priority so they may not get there in a timely manner.
Re:Re: CVE-2014-6271 – remote code execution through bash by psgbg on Friday September 26, 2014 @09:18AM (#8372519)
Yeah. I'm aware that stable and old stable need to be patched first, I was just surprised by how much time it took considering the kind of risk (and being beaten by sid, the kid whom always breaks his toys).
Re:Re: CVE-2014-6271 – remote code execution through bash by ScottBurson on Friday September 26, 2014 @01:31AM (#8371483)
I did 'yum update bash' on my Centos 5.8 Linode a couple of hours ago, and it updated to 3.2-33 and is apparently no longer vulnerable, according to the one-line test I have been using:

  X="() { :;} ; echo busted" /bin/sh -c "echo stuff"
Re:Re: CVE-2014-6271 – remote code execution through bash by gklyne on Friday September 26, 2014 @03:18AM (#8371689)
That test doesn't detect the vulnerability - needs to mention /bin/bash not /bin/sh
Re:Re: CVE-2014-6271 – remote code execution through bash by bigbugbag on Friday September 26, 2014 @04:09AM (#8371807)
Well, maybe you should look at your /bin/sh

ls -l /bin/sh

lrwxrwxrwx 1 root root 4 Sep 24 08:07 /bin/sh -> bash

Re:Re: CVE-2014-6271 – remote code execution through bash by makomk on Friday September 26, 2014 @05:16AM (#8371955)
I think /bin/sh is /bin/bash on CentOS and RedHat, but Debian, Ubuntu and probably other distros use dash as /bin/sh instead which was never vulnerable.
Re:Re: CVE-2014-6271 – remote code execution through bash by darkr on Friday September 26, 2014 @05:10AM (#8371933)
CentOS released a patched bash package around 2AM GMT, something like an hour after RedHat.
Re:Re: CVE-2014-6271 – remote code execution through bash by pandog on Friday September 26, 2014 @04:41AM (#8371874)
Looks like 14.10 is patched now
Re:Re: CVE-2014-6271 – remote code execution through bash by xd on Friday September 26, 2014 @07:26AM (#8372246)
There seems to have been some confusion about the effect of this feature on PHP in previous threads on HN. If you are running mod_php you are unaffected even if you use exec / system etc as the Apache PHP SAPI doesn't pass the environment variables to the sub process.

However if you pass any user data (_POST, _GET, etc) into a system/exec etc call that sets an environment variable then you would be vulnerable.

Re:Re: CVE-2014-6271 – remote code execution through bash by LeoPanthera on Friday September 26, 2014 @12:37AM (#8371350)
Re:Re: CVE-2014-6271 – remote code execution through bash by Turbo_hedgehog on Friday September 26, 2014 @01:04AM (#8371414)
If you have some RHEL4 machines that you still haven't retired:

wget https://oss.oracle.com/el4/SRPMS-updates/bash-3.0-27.0.2.el4...

rpm -ivh bash-3.0-27.0.2.el4.src.rpm

rpmbuild -ba /usr/src/redhat/SPECS/bash.spec

rpm -Uvh /usr/src/redhat/RPMS/x86_64/bash-3.0-27.0.2.x86_64.rpm

Re:Re: CVE-2014-6271 – remote code execution through bash by takefive1 on Friday September 26, 2014 @07:08AM (#8372209)
I don't understand. I see that the fix causes bash to ignore function definitions in the environment variable. But why should bash interpret the variable's content in the first place, and not treat it as a string? I suppose that someone can use eval if he really wants to execute it.
Re:Re: CVE-2014-6271 – remote code execution through bash by wincent on Friday September 26, 2014 @02:00AM (#8371540)
Amazon has released packages for their Linux AMIs that deal with both CVEs: https://alas.aws.amazon.com/ALAS-2014-419.html
Re:Re: CVE-2014-6271 – remote code execution through bash by ck2 on Friday September 26, 2014 @12:49AM (#8371376)
Re:Re: CVE-2014-6271 – remote code execution through bash by shawabawa3 on Friday September 26, 2014 @05:51AM (#8372016)
My server actually got hacked through this. I patched the first vulnerability quickly (arch linux, just did pacman -Sy bash). The second vulnerability was published overnight, tried to ssh to my box to patch it in the morning: "enter password:" - uh oh, I use public key auth

My server runs a couple of wordpress sites and a rails app - not sure where the vulnerability was exploited but be warned, looks like bots are already crawling for it

Re:Re: CVE-2014-6271 – remote code execution through bash by Erwin on Friday September 26, 2014 @06:07AM (#8372055)
Huh. I thought the second issue did not have an exploit? That when set, all would happen was that running "X Y" via a shell could instead run "Y > X " ?
Re:Re: CVE-2014-6271 – remote code execution through bash by scintill76 on Friday September 26, 2014 @06:34AM (#8372121)
If the attacker can control a list of arguments and an env var value, you're back to arbitrary command execution, albeit redirected somewhere. That sounds suspiciously insecure even without bash vulnerabilities, though. Would be interesting if GP knows what they used.
Re:Re: CVE-2014-6271 – remote code execution through bash by shawabawa3 on Friday September 26, 2014 @06:59AM (#8372190)
I have no idea, I wasn't able to access any logs or anything.

It's possible they had already installed a backdoor using the first vulnerability before I patched it, or perhaps something else entirely (though that's a little too coincidental)

Re:Re: CVE-2014-6271 – remote code execution through bash by dperfect on Friday September 26, 2014 @12:42AM (#8371358)
Ubuntu: http://people.canonical.com/~ubuntu-security/cve/2014/CVE-20...

RHEL: https://rhn.redhat.com/errata/RHSA-2014-1306.html

CentOS update is available also - just not on some mirrors yet.

Re:Re: CVE-2014-6271 – remote code execution through bash by Thesaurus on Friday September 26, 2014 @12:48AM (#8371373)
I just patched my CentOS 6 server a few hours ago. Double check yum.
Re:Re: CVE-2014-6271 – remote code execution through bash by 89vision on Friday September 26, 2014 @12:57AM (#8371392)
I patched mine about 10 hours ago. Is this one newer?
Re:Re: CVE-2014-6271 – remote code execution through bash by dperfect on Friday September 26, 2014 @01:00AM (#8371401)
Make sure you have bash-4.1.2-15.el6_5.2 instead of bash-4.1.2-15.el6_5.1 which was the initial patch.
Re:Re: CVE-2014-6271 – remote code execution through bash by austinheap on Friday September 26, 2014 @01:00AM (#8371403)
Yup.
Re:Re: CVE-2014-6271 – remote code execution through bash by andruby on Friday September 26, 2014 @03:33AM (#8371725)
I don't see the new update on Ubuntu 12.04. What version of bash contains the complete fix? I'm still at 4.2.25(1)-release
Re:Re: CVE-2014-6271 – remote code execution through bash by isp on Friday September 26, 2014 @05:07AM (#8371927)
http://www.ubuntu.com/usn/usn-2363-1/ - Ubuntu 12.04, bash 4.2-2ubuntu2.3.
Re:Re: CVE-2014-6271 – remote code execution through bash by brador on Friday September 26, 2014 @04:05AM (#8371792)
Is any fix going to be rolled out to older no longer supported versions of Linux? I know they're out of support but I think this is a special case and deserves the attention.
Re:Re: CVE-2014-6271 – remote code execution through bash by dspillett on Friday September 26, 2014 @07:00AM (#8372195)
Highly unlikely. Anyone still running an out-of-support instance who isn't manually applying updates is already vulnerable to other unpatched issues anyway, and those held back on old versions who are manually applying security updates (by compiling their own from upstream source and such) will already be on the ball with this one.
Re:Re: CVE-2014-6271 – remote code execution through bash by Thesaurus on Friday September 26, 2014 @12:47AM (#8371370)
Very thankful this made it out today.
Re:Re: CVE-2014-6271 – remote code execution through bash by arecurrence on Friday September 26, 2014 @01:25AM (#8371469)
Agreed, kudos to everyone for the speedy response!