Last Updated: February 25, 2016
·
627
· ccastillo

Fix bash shellshock bug in two steps (Ubuntu)

Frist, check if your machine is vulnerable (this command can be ran any *nix environment)

env x='() { :;}; echo vulnerable' bash -c 'echo hello'

If prints the following output, then your machine is vulnerable:

vulnerable
hello

If the printed output is the following, then your version of bash is fixed:

bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x'
hello

To fix this vulnerability, you have to upgrade your version of bash (and avoid other package updates):

sudo apt-get install --only-upgrade bash

There are (official) patched versions for 10.04 LTS, 12.04 LTS and 14.04 LTS.