centosThe Shellshock vulnerability and evidence of its use has now been widely reported in tech media.  Like the Heartbleed exploit I wrote about back in April, the sheer breadth of the vulnerability is staggering.  All of the mainstream Linux distributions contain the vulnerability, which means a large percentage of servers in the web hosting world contain the exploit.

What does the vulnerability look like in the real world?  Here’s a simple test script:

The vulnerability allows the code following the definition of a function to be executed. This provides a vector for all kinds of malicious behavior, including exposing information on the affected server, sending spam, or using the server to attack other servers.

Fortunately, the Linux distributions have moved quickly to fix the vulnerability and make patches available.  CentOS has an updated version of bash, which can be updated with yum.  After logging in as root on your server, execute the following command:

After the patch, the same example code we used above produces an error when trying to define the function, which stops the trailing code from executing:

If you’re running any type of Linux distribution that is Internet accessible, patch this vulnerability as soon as possible.