Bashdoor
   HOME

TheInfoList



OR:

Shellshock, also known as Bashdoor, is a family of
security bug A security bug or security defect is a software bug that can be exploited to gain unauthorized access or privileges on a computer system. Security bugs introduce security vulnerabilities by compromising one or more of: * Authentication of users ...
sAlthough described in some sources as a "virus," Shellshock is instead a design flaw in a program that comes with some operating systems. See => in the
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
Bash
shell Shell may refer to: Architecture and design * Shell (structure), a thin structure ** Concrete shell, a thin shell of concrete, usually with no interior columns or exterior buttresses Science Biology * Seashell, a hard outer layer of a marine ani ...
, the first of which was disclosed on 24 September 2014. Shellshock could enable an attacker to cause Bash to execute arbitrary commands and gain unauthorized access to many Internet-facing services, such as web servers, that use Bash to process requests. On 12 September 2014, Stéphane Chazelas informed Bash's maintainer Chet Ramey of his discovery of the original bug, which he called "Bashdoor". Working with security experts, Mr. Chazelas developed a patch (fix) for the issue, which by then had been assigned the vulnerability identifier '. The existence of the bug was announced to the public on 2014-09-24, when Bash updates with the fix were ready for distribution. The bug Chazelas discovered caused Bash to unintentionally execute commands when the commands are concatenated to the end of function definitions stored in the values of
environment variable An environment variable is a user-definable value that can affect the way running processes will behave on a computer. Environment variables are part of the environment in which a process runs. For example, a running process can query the va ...
s. Within days of its publication, a variety of related vulnerabilities were discovered ('). Ramey addressed these with a series of further patches. Attackers exploited Shellshock within hours of the initial disclosure by creating
botnet A botnet is a group of Internet-connected devices, each of which runs one or more Internet bot, bots. Botnets can be used to perform distributed denial-of-service attack, distributed denial-of-service (DDoS) attacks, steal data, send Spamming, sp ...
s of compromised computers to perform distributed denial-of-service attacks and vulnerability scanning. Security companies recorded millions of attacks and probes related to the bug in the days following the disclosure. Because of the potential to compromise millions of unpatched systems, Shellshock was compared to the
Heartbleed Heartbleed is a security bug in some outdated versions of the OpenSSL cryptography library, which is a widely used implementation of the Transport Layer Security (TLS) protocol. It was introduced into the software in 2012 and publicly disclos ...
bug in its severity.


Background

The Shellshock bug affects Bash, a program that various
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
-based systems use to execute command lines and command scripts. It is often installed as the system's default
command-line interface A command-line interface (CLI) is a means of interacting with software via command (computing), commands each formatted as a line of text. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user ...
. Analysis of the
source code In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer. Since a computer, at base, only ...
history of Bash shows the bug was introduced on 5 August 1989, and released in Bash version 1.03 on 1 September 1989. Shellshock is an
arbitrary code execution In computer security, arbitrary code execution (ACE) is an attacker's ability to run any commands or code of the attacker's choice on a target machine or in a target process. An arbitrary code execution vulnerability is a security flaw in softwa ...
vulnerability that offers a way for users of a system to execute commands that should be unavailable to them. This happens through Bash's "function export" feature, whereby one Bash
process A process is a series or set of activities that interact to produce a result; it may occur once-only or be recurrent or periodic. Things called a process include: Business and management * Business process, activities that produce a specific s ...
can share command scripts with other Bash processes that it executes. This feature is implemented by encoding the scripts in a table that is shared between the processes, known as the
environment variable An environment variable is a user-definable value that can affect the way running processes will behave on a computer. Environment variables are part of the environment in which a process runs. For example, a running process can query the va ...
list. Each new Bash process scans this table for encoded scripts, assembles each one into a command that defines that script in the new process, and executes that command. The new process assumes that the scripts found in the list come from another Bash process, but it cannot verify this, nor can it verify that the command that it has built is a properly formed script definition. Therefore, an attacker can execute arbitrary commands on the system or exploit other bugs that may exist in Bash's command interpreter, if the attacker has a way to manipulate the environment variable list and then cause Bash to run. At the time the bug was discovered, Bash was installed on
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
and many
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
operating systems as the main command interpreter, so that any program that used the system function to run any other program would use Bash to do so. The presence of the bug was announced to the public on 2014-09-24, when Bash updates with the fix were ready for distribution, though it took some time for computers to be updated to close the potential security issue.


Reports of attacks

Within an hour of the announcement of the Bash vulnerability, there were reports of machines being compromised by the bug. By 25 September 2014,
botnet A botnet is a group of Internet-connected devices, each of which runs one or more Internet bot, bots. Botnets can be used to perform distributed denial-of-service attack, distributed denial-of-service (DDoS) attacks, steal data, send Spamming, sp ...
s based on computers compromised with exploits based on the bug were being used by attackers for
distributed denial-of-service In computing, a denial-of-service attack (DoS attack) is a cyberattack in which the perpetrator seeks to make a machine or network resource unavailable to its intended users by temporarily or indefinitely disrupting services of a host conne ...
(DDoS) attacks and vulnerability scanning.
Kaspersky Labs Kaspersky Lab (; ) is a Russian multinational cybersecurity and anti-virus provider headquartered in Moscow, Russia, and operated by a holding company in the United Kingdom. It was founded in 1997 by Eugene Kaspersky, Natalya Kaspersky and ...
reported that machines compromised in an attack, dubbed "Thanks-Rob", were conducting DDoS attacks against three targets, which they did not identify. On 26 September 2014, a Shellshock-related botnet dubbed "wopbot" was reported, which was being used for a DDoS attack against
Akamai Technologies Akamai Technologies, Inc. is an American company specialized in content delivery networkJ. Dilley, B. Maggs, J. Parikh, H. Prokop, R. Sitaraman, and B. Weihl. (CDN), cybersecurity, DDoS mitigation, and cloud services. It is headquartered in ...
and to scan the
United States Department of Defense The United States Department of Defense (DoD, USDOD, or DOD) is an United States federal executive departments, executive department of the federal government of the United States, U.S. federal government charged with coordinating and superv ...
. On 26 September, the security firm
Incapsula Imperva Incapsula is an American cloud-based application delivery platform. It uses a global content delivery network to provide web application security, DDoS mitigation, content caching, application delivery, load balancing and failover serv ...
noted 17,400 attacks on more than 1,800 web domains, originating from 400 unique IP addresses, in the previous 24 hours; 55% of the attacks were coming from China and the United States. By 30 September, the website performance firm
CloudFlare Cloudflare, Inc., is an American company that provides content delivery network services, cybersecurity, DDoS mitigation, wide area network services, reverse proxies, Domain Name Service, ICANN-accredited domain registration, and other se ...
said it was tracking approximately 1.5 million attacks and probes per day related to the bug. On 6 October, it was widely reported that
Yahoo! Yahoo (, styled yahoo''!'' in its logo) is an American web portal that provides the search engine Yahoo Search and related services including My Yahoo, Yahoo Mail, Yahoo News, Yahoo Finance, Yahoo Sports, y!entertainment, yahoo!life, and its a ...
servers had been compromised in an attack related to the Shellshock issue. Yet the next day, it was denied that it had been ''Shellshock'' that specifically had allowed these attacks.


Specific exploitation vectors

; CGI-based web server : When a
web server A web server is computer software and underlying Computer hardware, hardware that accepts requests via Hypertext Transfer Protocol, HTTP (the network protocol created to distribute web content) or its secure variant HTTPS. A user agent, co ...
uses the
Common Gateway Interface file:Common Gateway Interface logo.svg, The official CGI logo from the spec announcement In computing, Common Gateway Interface (CGI) is an interface specification that enables web servers to execute an external program to process HTTP or HTTPS ...
(CGI) to handle a document request, it copies certain information from the request into the environment variable list and then delegates the request to a handler program. If the handler is a Bash script, or if it executes Bash, then Bash will receive the environment variables passed by the server and will process them as described above. This provides a means for an attacker to trigger the Shellshock vulnerability with a specially crafted document request. : Security documentation for the widely used
Apache The Apache ( ) are several Southern Athabaskan language-speaking peoples of the Southwestern United States, Southwest, the Southern Plains and Northern Mexico. They are linguistically related to the Navajo. They migrated from the Athabascan ho ...
web server states: "CGI scripts can ... be extremely dangerous if they are not carefully checked," and other methods of handling web server requests are typically used instead. There are a number of online services which attempt to test the vulnerability against web servers exposed to the Internet. ; OpenSSH server : OpenSSH has a "ForceCommand" feature, where a fixed command is executed when the user logs in, instead of just running an unrestricted command shell. The fixed command is executed even if the user specified that another command should be run; in that case the original command is put into the environment variable "SSH_ORIGINAL_COMMAND". When the forced command is run in a Bash shell (if the user's shell is set to Bash), the Bash shell will parse the SSH_ORIGINAL_COMMAND environment variable on start-up, and run the commands embedded in it. The user has used their restricted shell access to gain unrestricted shell access, using the Shellshock bug. ; DHCP clients : Some
DHCP The Dynamic Host Configuration Protocol (DHCP) is a network management protocol used on Internet Protocol (IP) networks for automatically assigning IP addresses and other communication parameters to devices connected to the network using a clie ...
clients can also pass commands to Bash; a vulnerable system could be attacked when connecting to an open Wi-Fi network. A DHCP client typically requests and gets an IP address from a DHCP server, but it can also be provided a series of additional options. A malicious DHCP server could provide, in one of these options, a string crafted to execute code on a vulnerable workstation or laptop. ; Qmail server : When using Bash to process email messages (e.g. through .forward or qmail-alias piping), the
qmail qmail is a mail transfer agent (MTA) that runs on Unix. It was written, starting December 1995, by Daniel J. Bernstein as a more secure alternative to the popular Sendmail program. Originally license-free software, qmail's source code wa ...
mail server passes external input through in a way that can exploit a vulnerable version of Bash. ; IBM HMC restricted shell : The bug can be exploited to gain access to Bash from the restricted shell of the
IBM Hardware Management Console Hardware Management Console (HMC) is a Physical / Virtual appliance used to manage IBM Systems including IBM AS/400, IBM System p, IBM System z, and IBM Power Systems. HMC supports command line (ssh) as well as web (https) user interfaces and RES ...
, a tiny Linux variant for system administrators. IBM released a patch to resolve this.


Reported vulnerabilities


Overview

The maintainer of Bash was warned about the first discovery of the bug on 2014-09-12; a fix followed soon. A few companies and distributors were informed before the matter was publicly disclosed on 2014-09-24 with CVE identifier . However, after the release of the patch there were subsequent reports of different, yet related vulnerabilities. On 26 September 2014, two open-source contributors, David A. Wheeler and Norihiro Tanaka, noted that there were additional issues, even after patching systems using the most recently available patches. In an email addressed to the oss-sec and bash-bug mailing lists, Wheeler wrote: "This patch just continues the 'whack-a-mole' job of fixing parsing errors that began with the first patch. Bash's parser is certain ohave many many many other vulnerabilities". On 27 September 2014,
Michał Zalewski Michał Zalewski (born 19 January 1981), also known by the user name lcamtuf, is a computer security expert and " white hat" hacker from Poland. He is a former Google Inc. employee (until 2018), and currently the VP of Security Engineering at ...
from Google Inc. announced his discovery of other Bash vulnerabilities, one based upon the fact that Bash is typically compiled without
address space layout randomization Address space layout randomization (ASLR) is a computer security technique involved in preventing exploitation of memory corruption vulnerabilities. In order to prevent an attacker from reliably redirecting code execution to, for example, a pa ...
. On 1 October, Zalewski released details of the final bugs and confirmed that a patch by Florian Weimer from
Red Hat Red Hat, Inc. (formerly Red Hat Software, Inc.) is an American software company that provides open source software products to enterprises and is a subsidiary of IBM. Founded in 1993, Red Hat has its corporate headquarters in Raleigh, North ...
posted on 25 September does indeed prevent them. He has done that using a
fuzzing In programming and software development, fuzzing or fuzz testing is an automated software testing technique that involves providing invalid, unexpected, or random data as inputs to a computer program. The program is then monitored for exceptio ...
technique with the aid of software utility known as ''
american fuzzy lop The American Fuzzy Lop is a rabbit breed recognized by the American Rabbit Breeders Association (ARBA). It is similar in appearance to a Holland Lop. However, the American Fuzzy Lop is a wool breed and will have wool similar to the Angora breeds ...
''.


Initial report (CVE-2014-6271)

This original form of the vulnerability () involves a specially crafted environment variable containing an exported function definition, followed by arbitrary commands. Bash incorrectly executes the trailing commands when it imports the function. The vulnerability can be tested with the following command: env x='() ; echo vulnerable' bash -c "echo this is a test" In systems affected by the vulnerability, the above commands will display the word "vulnerable" as a result of Bash executing the command ''"echo vulnerable"'', which was embedded into the specially crafted environment variable named ''"x"''.


CVE-2014-6277

Discovered by
Michał Zalewski Michał Zalewski (born 19 January 1981), also known by the user name lcamtuf, is a computer security expert and " white hat" hacker from Poland. He is a former Google Inc. employee (until 2018), and currently the VP of Security Engineering at ...
, the vulnerability , which relates to the parsing of function definitions in environment variables by Bash, can cause a
segfault In computing, a segmentation fault (often shortened to segfault) or access violation is a failure condition raised by hardware with memory protection, notifying an operating system (OS) the software has attempted to access a restricted area of m ...
.


CVE-2014-6278

Also discovered by
Michał Zalewski Michał Zalewski (born 19 January 1981), also known by the user name lcamtuf, is a computer security expert and " white hat" hacker from Poland. He is a former Google Inc. employee (until 2018), and currently the VP of Security Engineering at ...
, this bug () relates to the parsing of function definitions in environment variables by Bash.


CVE-2014-7169

On the same day the original vulnerability was published,
Tavis Ormandy Tavis Ormandy is an English computer security white hat hacker. He is currently employed by Google and was formerly part of Google's Project Zero team. Notable discoveries Ormandy is credited with discovering severe vulnerabilities in LibTIF ...
discovered this related bug (), which is demonstrated in the following code: env X='() { (a)=>\' bash -c "echo date"; cat echo On a vulnerable system, this would execute the command "date" unintentionally. Here is an example of a system that has a patch for CVE-2014-6271 but not CVE-2014-7169: $ X='() { (a)=>\' bash -c "echo date" bash: X: line 1: syntax error near unexpected token `=' bash: X: line 1: `' bash: error importing function definition for `X' $ cat echo Fri Sep 26 01:37:16 UTC 2014 The system displays syntax errors, notifying the user that CVE-2014-6271 has been prevented, but still writes a file named 'echo', into the working directory, containing the result of the 'date' call. A system patched for both CVE-2014-6271 and CVE-2014-7169 will simply echo the word "date" and the file "echo" will ''not'' be created, as shown below: $ X='() { (a)=>\' bash -c "echo date" date $ cat echo cat: echo: No such file or directory


CVE-2014-7186

Florian Weimer and Todd Sabin found this bug (), which relates to an out-of-bounds memory access error in the Bash parser code. An example of the vulnerability, which leverages the use of multiple "<"here documents"): bash -c 'true < A vulnerable system will echo the text "CVE-2014-7186 vulnerable, redir_stack".


CVE-2014-7187

Also found by Florian Weimer, is an
off-by-one error An off-by-one error or off-by-one bug (known by acronyms OBOE, OBOB, OBO and OB1) is a logic error that involves a number that differs from its intended value by 1. An off-by-one error can sometimes appear in a mathematics, mathematical context. ...
in the Bash parser code, allowing out-of-bounds memory access. An example of the vulnerability, which leverages the use of multiple "done" declarations: (for x in {1..200} ; do echo "for x$x in ; do :"; done; for x in {1..200} ; do echo done ; done) , bash , , echo "CVE-2014-7187 vulnerable, word_lineno" A vulnerable system will echo the text "CVE-2014-7187 vulnerable, word_lineno". This test requires a shell that supports
brace expansion In computing, Bash (short for "''Bourne Again SHell''") is an interactive command interpreter and command programming language developed for UNIX-like operating systems. Created in 1989 by Brian Fox for the GNU Project, it is supported by the Fre ...
.


Patches

Until 24 September 2014, Bash maintainer Chet Ramey provided a patch version bash43-025 of Bash 4.3 addressing CVE-2014-6271, which was already packaged by distribution maintainers. On 24 September, bash43-026 followed, addressing CVE-2014-7169. Then CVE-2014-7186 was discovered. Florian Weimer from
Red Hat Red Hat, Inc. (formerly Red Hat Software, Inc.) is an American software company that provides open source software products to enterprises and is a subsidiary of IBM. Founded in 1993, Red Hat has its corporate headquarters in Raleigh, North ...
posted some patch code for this "unofficially" on 25 September, which Ramey incorporated into Bash as bash43-027.—These patches provided ''source code'' only, helpful only for those who know how to
compile In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
(" rebuild") a new Bash
binary executable In computer science, executable code, an executable file, or an executable program, sometimes simply referred to as an executable or binary, causes a computer "to perform indicated tasks according to encoded instructions", as opposed to a da ...
file from the patch file and remaining source code files. The patches added a variable name prefix when functions are exported; this prevented arbitrary variables from triggering the vulnerability and enabled other programs to remove Bash functions from the environment. The next day, Red Hat officially presented according updates for
Red Hat Enterprise Linux Red Hat Enterprise Linux (RHEL) is a commercial Linux distribution developed by Red Hat. Red Hat Enterprise Linux is released in server versions for x86-64, Power ISA, ARM64, and IBM Z and a desktop version for x86-64. Fedora Linux and ...
, after another day for Fedora 21.
Canonical Ltd. Canonical Ltd. is a privately-held computer software company based in London, England. It was founded and funded by South African entrepreneur Mark Shuttleworth to market commercial support and related services for Ubuntu and related projects. ...
presented updates for its
Ubuntu Ubuntu ( ) is a Linux distribution based on Debian and composed primarily of free and open-source software. Developed by the British company Canonical (company), Canonical and a community of contributors under a Meritocracy, meritocratic gover ...
''Long Term Support'' versions on Saturday, 27 September; on Sunday, there were updates for
SUSE Linux Enterprise SUSE Linux Enterprise (SLE) is a Linux-based operating system developed by SUSE. It is available in two editions, suffixed with Server (SLES) for servers and mainframes, and Desktop (SLED) for workstations and desktop computers. Its major ve ...
. The following Monday and Tuesday at the end of the month,
Mac OS X macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
updates appeared. On 1 October 2014,
Michał Zalewski Michał Zalewski (born 19 January 1981), also known by the user name lcamtuf, is a computer security expert and " white hat" hacker from Poland. He is a former Google Inc. employee (until 2018), and currently the VP of Security Engineering at ...
from Google Inc. finally stated that Weimer's code and bash43-027 had fixed not only the first three bugs but even the remaining three that were published after bash43-027, including his own two discoveries. This means that after the earlier distribution updates, no other updates have been required to cover all the six issues. All of them have also been covered for the IBM ''Hardware Management Console''.


References


External links

*
NIST The National Institute of Standards and Technology (NIST) is an agency of the United States Department of Commerce whose mission is to promote American innovation and industrial competitiveness. NIST's activities are organized into physical s ...
br>National Vulnerability Database
& CVEbr>Common Vulnerabilities and Exposures
** CVE-2014-6271
20140924nist

20140909cve
(first bug) ** CVE-2014-6277
20140927nist

20140909cve
** CVE-2014-6278
20140930nist

20140909cve
** CVE-2014-7169
20140924nist

20140924cve
(second bug) ** CVE-2014-7186
20140929nist

20140925cve
** CVE-2014-7187
20140929nist

20140925cve

Bash source code
from the
GNU Project The GNU Project ( ) is a free software, mass collaboration project announced by Richard Stallman on September 27, 1983. Its goal is to give computer users freedom and control in their use of their computers and Computer hardware, computing dev ...
, includes patches for known vulnerabilities (28 September 2014)
"Shellshock in the Wild", Malware droppers, Reverse shells & backdoors, Data exfiltration, and DDoS
at FireEye, Inc.
Collection of attacks seen in the wild (29 September 2014)
at
SANS Institute The SANS Institute (officially the Escal Institute of Advanced Technologies) is a private U.S. for-profit company founded in 1989 that specializes in information security, cybersecurity training, and selling certificates. Topics available for tr ...

Security Alert for CVE-2014-7169
at
Oracle An oracle is a person or thing considered to provide insight, wise counsel or prophetic predictions, most notably including precognition of the future, inspired by deities. If done through occultic means, it is a form of divination. Descript ...

"VMware remediation of Bash Code Injection Vulnerability via Specially Crafted Environment Variables"
at VMware
Cyberwatch Vulnerabilities Database
*
CVE-2014-6271
*
CVE-2014-6277
*
CVE-2014-6278
*
CVE-2014-7169
*
CVE-2014-7186
*
CVE-2014-7187

ShellShock Exploitation with Metasploit Framework
{{Hacking in the 2010s 2014 in computing Injection exploits Internet security Software bugs Computer security exploits