247 points · by 0x0 · 12y ago · 155 comments
$ curl -s https://raw.githubusercontent.com/hannob/bashcheck/master/bashcheck | bash
Not vulnerable to CVE-2014-6271 (original shellshock)
Not vulnerable to CVE-2014-7169 (taviso bug)
bash: line 18: 14885 Segmentation fault: 11 bash -c "true $(printf '<<EOF %.0s' {1..79})" 2> /dev/null
Vulnerable to CVE-2014-7186 (redir_stack bug)
Test for CVE-2014-7187 not reliable without address sanitizer
Variable function parser inactive, likely safe from unknown parser bugsBut there's a lot of spectrum between "i have audited this software" and "i'm just piping this random url off the web to my shell". Many software distribution mechanisms provide varying degrees of curation, reputation, accountability etc.
Also in this case the link was provided in a context that would select for people who are concerned about security updates (= looking after high value systems) and still somewhat naive about security practices, and could get run on systems that have strict rules about installing software on them.
Certainly, one can't audit every line, but just as certainly, one can establish a train of trusted sources and audit the rest (like this tiny snippet of bash, which is so utterly trivial to verify you might as well polish the habit on it).
I'd rather take an extra few seconds to do:
$ curl https://raw.githubusercontent.com/hannob/bashcheck/master/bashcheck > bashcheck.sh
$ cat bashcheck.sh # nothing fishy
$ chmod +x bashcheck.sh && ./bashcheck.shhttps://raw.githubusercontent.com/hannob/bashcheck/9ee8db0bf...
(This assumes Github hasn't been rooted and you don't have a MITM with access to a trusted CA but … almost everyone is screwed at that point)
$ foo() { echo foo; }
$ foo
foo
$ export -f foo
I got this variable: __BASH_FUNC<foo>()=() { echo foo
} ~$ echo $BASH_VERSION
4.3.25(1)-release
~$ curl -s https://raw.githubusercontent.com/hannob/bashcheck/master/bashcheck | bash
bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x'
Not vulnerable to CVE-2014-6271 (original shellshock)
Vulnerable to CVE-2014-7169 (taviso bug)
bash: line 18: 1339 Segmentation fault: 11 bash -c "true $(printf '<<EOF %.0s' {1..79})" 2> /dev/null
Vulnerable to CVE-2014-7186 (redir_stack bug)
Test for CVE-2014-7187 not reliable without address sanitizer
Variable function parser still active, likely vulnerable to yet unknown parser bugs like CVE-2014-6277 (lcamtuf bug)
And fwiw even before install new bash via homebrew I had also followed these instructions:http://apple.stackexchange.com/questions/146849/how-do-i-rec...
Brew installs bash at `/usr/local/bin/`.
Not vulnerable to CVE-2014-6271 (original shellshock)
Not vulnerable to CVE-2014-7169 (taviso bug)
Not vulnerable to CVE-2014-7186 (redir_stack bug)
Test for CVE-2014-7187 not reliable without address sanitizer
Variable function parser inactive, likely safe from unknown parser bugs
And for 10.7: http://support.apple.com/kb/DL1767
Edit: Further information from the announcement is available here: http://lists.apple.com/archives/security-announce/2014/Sep/m...
The direct download pages are published first. It should be showing up on the update servers shortly.
This addresses CVE-2014-6271 and CVE-2014-7169 only. There are currently 6 CVEs listed on the Wikipedia page (not sure which are accurate): http://en.wikipedia.org/wiki/Shellshock_%28software_bug%29#S...
Some protection is better than none and I'm glad to see Apple rapidly responding. But this doesn't fix all the issues known to exist currently.
> I'm glad to see Apple rapidly responding
It seems we have different expectations concerning the term rapid...3-5 days is pretty decent considering that the DHCP stack on OS X isn't vulnerable and only customers that had enabled the apache2 instance and configured it with non-default mods were possibly affected.
More often than not Apple is removing GPL code from OS X altogether in the face of issues (example: samba is now replaced with 'smbx' in-house implementation).
I felt it was 50/50 that they'd update it vs. remove/disable it.
> 3-5 days is pretty decent ...
According to the timestamps on the GNU ftp site for bash, the first patch was released 2014-09-24 10:24 (unknown timezone).
Slackware had their first upgrade file-set out at Wed, 24 Sep 2014 16:37:00 -0700 (PDT) (for six different versions, in both i386 and x86_64 variants).
The second patch is timestamped 26-Sep-2014 17:02 on the GNU ftp site. Slackware's second upgrade file-set was out Thu, 25 Sep 2014 13:38:49 -0700 (PDT) (again with twelve different packages). [no idea why there is time travel here, likely the datestamp on the ftp site was subsequently updated for some reason]
The final patch is timestamped 27-Sep-2014 22:38 on the GNU site, and Slackware had out their third upgrade file-sets at Mon, 29 Sep 2014 12:33:36 -0700 (PDT).
Without knowing the FSF's timezone, we can only make estimates, but, for the first patch: same day, second patch: unknown, the time travel effect prevents making any estimates, third patch: about a day and a half.
And other distro's had patches out even earlier than Slackware, so, no, 3-5 days is _not_ pretty decent, it is actually downright poor.
Edit: If you disagree with me, please reply instead of downvoting.
Oh, you mean host any website that isn't a single static html page .... :/
Apple didn't make the patch they just repackaged it. That's five days to write a dozen lines of script to update the shell. Every single GNU/Linux distro was patched the day of, get real.
>I felt it was 50/50 that they'd update it vs. remove/disable it.
Remove it for what ash/sh? Tim Cook doesn't know a megabit from a megabyte, let alone a shell. That pencil pusher doesn't care about his users, only the money. This was only patched for PR. Still no sight of it on the automatic updates list.
Apple's certainly gotten a late start, but the "1.0" part of the update's name speaks to an expectation that this isn't the end of the line here.
(Of peripheral interest, whilst checking in the iOS Dev Center, I noticed there's a beta of iOS 8.1)
Since we didn't see another DP this week, I'm assuming the Bash update will appear in the RC... hopefully that's out soon.
Note that the patch from Apple allows bash functions to be escaped, albeit with a BASH_FUNC prefix - but you can get around this by using:
$ env '__BASH_FUNC<ls>()'="() { echo Game Over; }" bash -c ls
Game Over
[1] http://alblue.bandlem.com/2014/09/bash-remote-vulnerability....
Quoted from 0x0
Also for 10.8: http://support.apple.com/kb/DL1768 And for 10.7: http://support.apple.com/kb/DL1767 Edit: Further information from the announcement is available here: http://lists.apple.com/archives/security-announce/2014/Sep/m....
Just posting it here incase someone reads your comment and misses 0x0's
I guess us Yosemite users will have to wait for the next beta...
There is a handy zsh script (zsh is in /bin on OSX by default) to get the Bash tarball from opensource.apple.com, apply patches 52, 53, and 54 from ftp.gnu.org, build it, and then prompt to replace /bin/bash and /bin/sh. Xcode is required, and you have to run "sudo xcodebuild" once to accept the EULA.
https://github.com/tjluoma/bash-fix
This is the easiest way I've found to patch the system-level /bin/bash AND /bin/sh binaries.
(For those wondering, the 10.9 installer does not run on 10.10)
I wouldn't call it disconcerting that they're focusing their resources on released versions of OS X. I'd rather they cover the other CVEs sooner and ship 10.10.0 with no issues[1] when it's done than divert engineering resources to ship a patch for Yosemite.
[1] bash-related issues, at least. Apple's .0 track record speaks for itself.
If you didn't do this: cmd + s to boot in safe mode. /sbin/mount -wu / and chmod bash back to a useable state, if you get stuck at log in.
(master) $ echo $BASH_VERSION
4.3.27(1)-release
(master) $ ./bashcheck
Not vulnerable to CVE-2014-6271 (original shellshock)
Not vulnerable to CVE-2014-7169 (taviso bug)
./bashcheck: line 18: 7675 Segmentation fault: 11 bash -c "true $(printf '<<EOF %.0s' {1..79})" 2> /dev/null
Vulnerable to CVE-2014-7186 (redir_stack bug)
Test for CVE-2014-7187 not reliable without address sanitizer
Variable function parser inactive, likely safe from unknown parser bugs
It seems as though there is no patch that fixes CVE-2014-7186 yet?This is a big deal because it's remotely exploitable. But it's only exploitable remotely if you are running a network daemon that somehow invokes bash and sets environment variables without sanitization. Web sharing, SSH in some instances, a few MTAs.
The average user PROBABLY isn't running a daemon that is vulnerable. Though in some cases, you may be and not know it (like if you had turned on Web Sharing at some point)
All of this is not to say that if you can apply the patch, do it.
foo='() { echo not patched; }' bash -c fooEven then, at least the exploit for DHCP I saw manifests on the SERVER, not the client. When you are in a coffee shop, you are the client not the server. That means you would be the one to exploit the coffee shop, not the other way around.
Would you say the same about Linux desktop users? Or do we tend to run Bash for more things? I'm unfamiliar with bash's role in OSX.
You should upgrade regardless, though, since bash is so ubiquitous that it's hard to be sure you're not vulnerable in some esoteric way.
Basically to be vulnerable requires 2 components:
1. You have to be able to get some remote user specified stuff into a environment variable.
2. You have to invoke /bin/sh (calls to system(3)[1] do this, as well as actual shell scripts).
If you just have a non-server mac, there's no huge rush--no one has identified an actual stock service/daemon that is susceptible to the vulnerability.[1] "man 3 system"
http://www.pcworld.com/article/2688672/two-scenarios-that-wo...
System Requirements
OS X Mavericks v10.9.5 or later
so, they're not updating older machines? My partner still runs Snow Leopard 10.6.8!Source: http://www.512pixels.net/blog/2014/9/apple-posts-bash-update...
http://arstechnica.com/apple/2014/03/snow-leopard-updates-ar...
With Apple stuff it seems like it's best to stay within 2 revisions of the latest OS, especially since they've moved to shorter release cycles (yearly).
If only Alt+Tab worked on windows rather than apps, like in MS OSs, or even if there was a taskbar-style way to switch windows, she'd have so many fewer problems...
This may not help for your case, but it may interest keyboard shortcut junkies.
When I was getting used to the "interesting" way OS X handles CMD+TAB versus Windows' ALT+TAB, I was also frustrated at the app-vs-window issue.
I eventually figured out this workaround, which sounds complicated but is now muscle memory:
1. Hold CMD. (Don't let go until I say so.)
2. Press TAB once.
3. Tap the arrow keys (LEFT/RIGHT) to go to the correct application, e.g. Chrome.
4. When you have the correct application selected, press DOWN. (You can release CMD now.)
5. This will display all of the open windows for this application (same as "4 finger swipe down" gesture). You can use the arrow keys to navigate this. An extremely subtle blue halo is displayed around the selected window. Press RETURN to select.
CMD-~ cycles through windows. hold-click or right-click on a Dock icon displays a list of Windows associated with the application
Alternatvely, perhaps she might like Exposé (try F3)
Apart from that, even on 10.6, you can do the update of Bash yourself, you're not required to use the Apple patch: https://github.com/ido/macosx-bash-92-shellshock-patched
This has been compiled on Mavericks, it may run on 10.6. If not, you may need to install Xcode
http://arstechnica.com/apple/2014/03/snow-leopard-updates-ar...
Maybe they're saying you should upgrade for security reasons, but it'd be nice if they actually said it. Seriously, I'm failing to understand the amount of downvote-hate being focused on you right now, in every comment you gave in this thread. Sorry.
> something that's still perfectly functional
More functional, sometimes; I have 10.6.8 on my home Mac Pro because 10.7 removed a vital feature.Here’s for the crazy ones, the misfits, the trouble makers, the round pegs in the square holes. The ones who see things differently... and are still running Snow Leopard.
Mavericks is apple's Windows Vista
> This update requires OS X version 10.9.
$ bash --version
GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)
After: $ bash --version
GNU bash, version 4.3.26(1)-release (x86_64-apple-darwin13.4.0)I didn't get that at all. Are you running ports maybe??
$ bash --version GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13) Copyright (C) 2007 Free Software Foundation, Inc.
$ bash --version GNU bash, version 3.2.53(1)-release (x86_64-apple-darwin13) Copyright (C) 2007 Free Software Foundation, Inc.
* The version after applying this update will be:
OS X Mavericks: GNU bash, version 3.2.53(1)-release (x86_64-apple-darwin13)
OS X Mountain Lion: GNU bash, version 3.2.53(1)-release (x86_64-apple-darwin12)
OS X Lion: GNU bash, version 3.2.53(1)-release (x86_64-apple-darwin11) port install bash
cat /opt/local/bin/bash >> /etc/shells
chsh -s /opt/local/bin/bash
mv /bin/bash /bin/bash-apple
ln /opt/local/bin/bash /bin/bash
solves the problem.