Bash script to fix the shellshock vulnerability on Mac OS X 10.9.5 (CVE-2014-6271)

This script will build and install a new version of bash and sh from source that will fix the bash shellshock vulnerability on Max OS X 10.9.5 until the official patch is released from Apple. It requires the XCode command line tools. If you do not have the XCode command line tools installed, I have made pre-built versions of bash and sh available for download.

Please note that you probably don’t need this patch unless you are running services that expose the vulnerability on an external port.

Many thanks to this blog for providing the key information: http://apple.stackexchange.com/questions/146849/how-do-i-recompile-bash-to-avoid-shellshock-the-remote-exploit-cve-2014-6271-an and to Chet Ramey for creating and distributing the patches so quickly.

Path, Build and Install the Fixed Versions of bash and sh

This is how you download the script and use it to install the updates.

Download, Verify and Install Pre-Built Versions of bash and sh

If you cannot build locally because you do not have the XCode command line tools installed, you can download and install the pre-built versions of bash and sh as follows.

Script Contents

This is the script. There is nothing fancy. It verifies that the OS version is correct and that the XCode command line tools are installed before downloading the bash source and patches which are then built and installed. Once installed it verifies that the patch worked.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.