Homebrew is a package management system for Mac. A lot of people use it to manage mysql, python, and (as you could have guessed) bash. What Homebrew does is simply install these packages and makes them available to the user. While some people do use it for bash, updating bash with Homebrew doesn't protect their entire system from shellshock (which my team tested and identified today).
What I would suggest you do is download XCode for your version of OS X, download the xcode command line utilities (by going to preferences -> downloads -> command line utilities) and then running this script I wrote. To be clear, this script is simply following the same steps outlined here, I just made it easier for the dev team to update.
You can copy this code into an executable bash script and run it using ./bash-fixer.sh
#!/bin/bash
# In all good conscience, I can not guarantee anything in this script.
# I've tested it to the best of my ability, but please use at your own risk
if [ "$EUID" -eq 0 ]; then
echo "DO NOT RUN AS SUDO! Running as sudo will break the world and will make your computer very unhappy."
echo "There are commands later that are appropriately sudo'd."
exit 1
fi
xcode-select --version
if [[ $? != 0 ]] ; then
echo "You need to install the xcode stuff that makes magic. Let's try that together"
xcode-select --install || echo "Something broke. Try running \"xcode-select --install\" manually" && exit 1
fi
cd ~/
test=$( env x='() { :;}; echo vulnerable' bash -c 'echo hello' | wc -l )
if [[ ${test} -lt 2 ]]; then
echo "Your version of bash is up to date"
else
mkdir -p bash-fix
cd bash-fix
curl https://opensource.apple.com/tarballs/bash/bash-92.tar.gz | tar zxf -
cd bash-92/bash-3.2
for i in $(seq -f "%03g" 52 54); do
curl https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-$i | patch -p0
done
cd ..
xcodebuild
sudo cp /bin/bash /bin/bash.old
sudo cp /bin/sh /bin/sh.old
echo
echo
echo "Current version of bash is $(build/Release/bash --version | head -1 | awk -F "version " '{ print $2 }')"
echo "Current version of sh is $(build/Release/sh --version | head -1 | awk -F "version " '{ print $2 }' )"
if [[ $(build/Release/bash --version) =~ "3.2.54(1)-release" && $(build/Release/sh --version) =~ "3.2.54(1)-release" ]]; then
echo "So far so good. Let's do some more checks, because we like dilligence"
else
echo "The bash and shell versions are not showing up as being the most recent. Something is afoot!"
exit 1
fi
if [[ "${test}" < 2 ]]; then
echo "Your version of bash is up to date"
exit 0
else
echo "Something went horribly wrong!"
exit 1
fi
echo "Awesome. All checks have passed. Cleaning up, and removing executable privaleges from the old bash and sh, just in case"
sudo cp build/Release/bash /bin
sudo cp build/Release/sh /bin
sudo chmod a-x /bin/bash.old /bin/sh.old
fi
Let me know how you make out, and good luck!