Homebrew Shellshock Fix

Last week a major bug in the Bash shell was found, CVE-2014-6271, which provides remote code execution from a malicious attacker.

Here’s a detailed account:

GNU Bash through 4.3 processes trailing strings after function definitions in the values of environment variables, which allows remote attackers to execute arbitrary code via a crafted environment, as demonstrated by vectors involving the ForceCommand feature in OpenSSH sshd, the mod_cgi and mod_cgid modules in the Apache HTTP Server, scripts executed by unspecified DHCP clients, and other situations in which setting the environment occurs across a privilege boundary from Bash execution, aka “ShellShock.” NOTE: the original fix for this issue was incorrect; CVE-2014-7169 has been assigned to cover the vulnerability that is still present after the incorrect fix.

Using homebrew the fix to patch this issue is quite easy:

brew update
brew upgrade bash

You can confirm if the exploit has been patched by running the following snippet of code:

env x='() { :; }; echo vulnerable' bash -c "echo patch me"

If the above patch still does not work I recommend trying:

brew uninstall bash
brew update
brew install bash

Don’t worry all of your .bashrc files and settings will still be in place.

Write a Comment

Your email address will not be published. Required fields are marked *