Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
Shellshock (CVE-2014-6271) let an attacker run commands on any system where Bash processed an attacker-influenced environment variable, which in 2014 meant a very large part of the internet.

What Is Shellshock?
Shellshock is CVE-2014-6271, a vulnerability in GNU Bash that allowed arbitrary command execution whenever Bash was started with an environment variable whose value an attacker could influence. Stephane Chazelas found it and reported it privately, and it was disclosed on 24 September 2014. The flaw had been present since Bash version 1.14, released in 1989—roughly twenty-five years of exposure.
Bash supports exporting shell functions to child processes. The mechanism is unusual: the function is passed through the environment as a variable whose value begins with () {, and when a new Bash process starts it recognises that prefix and defines the function.
The parser, however, did not stop at the end of the function definition. Anything following the closing brace was executed immediately as a command. So an environment variable set to:
() { :;}; /usr/bin/id
caused Bash to define an empty function and then run id, at start-up, before the shell had done anything else.
Setting an environment variable is not normally an attacker capability. The problem was how many systems did it with data from the network.
HTTP_USER_AGENT, HTTP_COOKIE, HTTP_REFERER. If the CGI script was a shell script, or invoked one, a crafted User-Agent header ran commands as the web server user. This was the dominant exploitation route, and it needed nothing more than curl with a custom header.SSH_ORIGINAL_COMMAND, which allowed a restricted user to escape the restriction.Exploitation began within hours of disclosure, which was faster than Heartbleed five months earlier because the exploit was a single HTTP header rather than a specialised protocol interaction. Mass scanning for vulnerable CGI endpoints started the same day.
The initial patch was also incomplete. Within a day, researchers showed the parser could still be reached by other means, producing CVE-2014-7169, and a cluster of further issues followed—CVE-2014-6277, CVE-2014-6278, CVE-2014-7186, and CVE-2014-7187—as the function parsing code received the scrutiny it had never previously had. Several rounds of distribution updates were required before the matter settled.
Payloads were mostly commodity: a botnet client named Wopbot appeared immediately, along with Mayhem and various IRC bots and reverse shells. Some embedded devices and network appliances were never patched at all and remain vulnerable today, which is where the occasional Shellshock finding in a scan still comes from.
Shellshock and Heartbleed arrived months apart in 2014 and together changed how the industry thought about open source dependencies. Both were in code that almost everything relied on and almost nobody funded.
The specific technical lesson has aged well. Shellshock, Log4Shell, and the various expression-language injection flaws all share a shape: a component parses attacker-controlled data in a context where that data can be interpreted as instructions. The defence is the same in each case—do not pass untrusted input into an interpreter, and where that is unavoidable, make the interpreter’s dangerous features off by default.
The operational lesson is about reachability. Organisations that did not run CGI, or that blocked outbound connections from web servers so a reverse shell could not connect back, had a far less eventful week than those that did neither. That principle has not changed, and it is the reason we assess outbound filtering and legacy interface exposure as part of Web Application Security Services rather than only testing the application logic.
Not on maintained systems, which were patched in 2014. It still appears on embedded devices, network appliances, industrial equipment, and forgotten servers whose vendors never issued an update or whose owners never applied one. Scanners find it occasionally on internal networks, almost always on hardware that has been running untouched for a decade.
The vulnerability is in Bash specifically, in its handling of exported shell functions. Other shells such as dash, zsh, ksh, and the BusyBox shell do not implement that mechanism and were unaffected. However, many systems have /bin/sh linked to Bash, so scripts that appear to use a different shell were still exposed. Checking the actual link target was part of assessing exposure.
The CGI specification requires request headers to be placed in environment variables before the script runs. If that script was a shell script, or invoked one, a header such as User-Agent containing the crafted function prefix caused Bash to execute the attacker’s command as the web server user. Exploitation required nothing more than an HTTP request with a modified header.
Do not pass untrusted data into an interpreter, and assume any component that parses input may treat it as instructions. The supporting lesson is about limiting reachability: organisations that had retired CGI, or that blocked outbound connections from web servers so reverse shells could not establish, were substantially less affected regardless of how quickly they patched.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.