Skip to content

Instantly share code, notes, and snippets.

@thom-nic
Created September 26, 2014 00:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thom-nic/db60c2f192bbf311f959 to your computer and use it in GitHub Desktop.
Save thom-nic/db60c2f192bbf311f959 to your computer and use it in GitHub Desktop.
Mac bash upgrade to mitigate the Shellshock exploit
# shellshock upgrade & patch for Mac OSX
# OSX ships with a horribly old version of bash (3.2) which is vulnerable to
# the Shellshock exploit (CVE-2014-6271)
# We use homebrew to get a recent version of bash, then symlink it to
# /bin/bash and /bin/sh (because sh is really bash)
#
# Use this to see if you're vulnerable
# env X="() { :;} ; echo vulnerable" /bin/bash -c "echo testing"
brew update && brew install bash
cd /bin
sudo mv bash bash.old
sudo ln -s /usr/local/bin/bash
sudo mv sh sh.old
sudo cp bash sh
@thom-nic
Copy link
Author

thom-nic commented Oct 7, 2014

if you already have bash installed via homebrew, just brew update && brew upgrade bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment