Original Link: http://apple.stackexchange.com/questions/146849/how-do-i-recompile-bash-to-avoid-the-remote-exploit-cve-2014-6271-and-cve-2014-7/146851#146851

There’s a nasty hole in the Terminal which effects Macs and should be patched. You can do so manually by following this thread on StackExchange.

I patched my Macs already, but note that you need Homebrew, MacPorts, or Xcode installed to use this method.