CVE-2014-6271 and CVE-2014-7169 Info – Bash Vulnerabilities

Posted on by J. Mays | Updated:
Reading Time: 2 minutes

On September 24th, a vulnerability was reported in the GNU Bourne-Again-Shell (BASh, or Bash), specifically a flaw with how Bash processes values of environment variables, that allows remote code execution of varying types in many common configurations. The overall risk is severe due to bash being configured for use, by default, on most Linux servers.

While Liquid Web immediately began working to proactively patch this vulnerability, some servers may remain vulnerable depending on their update settings or other unforeseen intervening factors. Thus, we’ve provided the instruction below.

To Summarize:

  • This flaw exploits Bash, a Unix command-line shell run by default on most Linux servers.
  • Allows for remote code execution, and many types of command-line based attacks.
  • A patch is available, and your server can be easily updated.
  • We have tutorials on How to Update Bash on Red Hat and CentOS and How to Update Bash on Debian and Ubuntu.
  • Test the vulnerability of your server with the information below.

The National Cyber Awareness System describes the issue as follows:

GNU Bash through 4.3 bash43-025 processes trailing strings after certain malformed function definitions in the values of environment variables, which allows remote attackers to write to files or possibly have unknown other impact via a crafted environment, as demonstrated by vectors involving the ForceCommand feature in OpenSSH sshd, the mod_cgi and mod_cgid modules in the Apache HTTP Server, scripts executed by unspecified DHCP clients, and other situations in which setting the environment occurs across a privilege boundary from Bash execution. NOTE: this vulnerability exists because of an incomplete fix for CVE-2014-6271.

Again, have tutorials on How to Update Bash on Red Hat and CentOS and How to Update Bash on Debian and Ubuntu.

Additional information on CVE-2014-6271 Bash Vulnerability can be found here.

Additional information on CVE-2014-7169 Bash Vulnerability can be found here.

Ubuntu specific information can be found here.

Red Hat specific information can be found here.

CentOS specific information can be found here.

Check Whether Your Server is Vulnerable

It is very easy to check whether or not your server is vulnerable by running the following (safe to run) code:

cd /tmp; rm -f /tmp/echo; env 'x=() { (a)=>\' bash -c "echo date"; cat /tmp/echo

If your server isn’t vulnerable, then the following will be displayed:

bash: x: line 1: syntax error near unexpected token `=’
bash: x: line 1: `’
bash: error importing function definition for `x’
date
cat: /tmp/echo: No such file or directory

Or in some cases simply:

date
cat: /tmp/echo: No such file or directory

If your server is vulnerable, then the following will be displayed (with the date):

bash: x: line 1: syntax error near unexpected token `=’
bash: x: line 1: `’
bash: error importing function definition for `x’
Fri Sep 26 11:55:07 EDT 2014

And the file /tmp/echo will be created.

Proceed to our tutorials on How to Update Bash on Red Hat and CentOS and How to Update Bash on Debian and Ubuntu. Once you follow the tutorials, confirm your server is no longer vulnerable by running the above code once more!

Avatar for J. Mays

About the Author: J. Mays

As a previous contributor, JMays shares his insight with our Knowledge Base center. In our Knowledge Base, you'll be able to find how-to articles on Ubuntu, CentOS, Fedora and much more!

Latest Articles

Blocking IP or whitelisting IP addresses with UFW

Read Article

CentOS Linux 7 end of life migrations

Read Article

Use ChatGPT to diagnose and resolve server issues

Read Article

What is SDDC VMware?

Read Article

Best authentication practices for email senders

Read Article