Shellshock: the Bash flaw that let one web request run commands
A flaw in Bash, the command shell of Linux and macOS, let attackers run commands on web servers with one request. How it worked, the attacks, the fix.

What to do now
- Update Bash through your system’s updates: Bash 4.3 needs patches 025 to 030, older versions the matching patches.
- Check embedded devices, such as appliances with built-in Linux, that no longer get updates: they may still run an unpatched Bash.
- Switch off CGI scripts on web servers that you no longer need: a single crafted web request reached Bash through them.
- Year
- 2014
- CVSS 3.1 score
- 9.8 critical
- of websites with a known operating system run on Linux today, where Bash is part of the system
- 63.2 %
- Shellshock attacks per second at first, at Cloudflare alone (vendor data)
- 10–15
- Reach met
Bash is part of the base operating system of Linux and macOS (US-CERT), and Linux alone runs 63.2 % of all websites whose operating system is known today (W3Techs, October 23, 2026).
- Mass exploitation met
Within four days, attacks hit more than 4,115 websites protected by Imperva, and Cloudflare blocked more than 1.1 million attacks (vendor data from Imperva and Cloudflare).
- Damage not met
No damage figures and no outages of critical services are documented; the attack counts come from vendors' sensors, not from damage reports.
- Extraordinary response not met
Six Bash patches came out in eleven days, but no measure beyond routine patching is documented (GNU Bash patch archive, US-CERT).
| Affected | GNU Bash, the command shell of Linux, Unix and macOS |
|---|---|
| CVE | CVE-2014-6271, CVE-2014-7169, CVE-2014-7186, CVE-2014-7187, CVE-2014-6277, CVE-2014-6278 |
| CVSS vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| Weakness (CWE) | CWE-78 |
| Fixed in | Bash 4.3 patches 025 to 030 (September 24 to October 5, 2014) and matching patches for older versions |
| On CISA's list of exploited vulnerabilities since | January 28, 2022 |
| Found by | An independent Unix and Linux specialist; follow-up flaws by other researchers |
- 1Earliest documented report, in Red Hat's bug tracker, still kept secret
- 2Made public+9 days
- 3Fix available+9 days
- 4The first fix proves incomplete; the way around it gets its own CVE+10 days
- 5Attacks peak in Cisco's sensor data+11 days
- 6Sixth and last Bash patch of the series+20 days
On September 24, 2014, a flaw became public in Bash, the command shell of Linux, Unix, and macOS: the program that reads commands and runs them. Through it, a single crafted web request could run any command on a web server. Cisco’s sensors recorded attacks on the same day, and it took six patches in eleven days to close the hole and the flaws found after it.
How it worked
Programs pass settings to the programs they start in environment variables: small pieces of text, each with a name. Bash uses them for one more job. It can hand its own small programs, called functions, to the next Bash it starts, by putting them into a variable whose text begins with () {.
Every new Bash process looked through all of its variables and turned each one that looked like a function into a function. To do that, it ran the text through its normal command reader, the parser. But the parser did not stop at the closing brace of the function: it also ran any command written after it.
This would have been harmless if only Bash wrote such variables. But many programs copy outside input into variables before they start a shell. Web servers do it for CGI scripts, small programs that a server starts to build a page: the User-Agent header of a request, the line that normally names the browser, becomes the variable HTTP_USER_AGENT. DHCP clients, which fetch network settings, do the same with settings sent by the network, and so does OpenSSH, the program for remote logins, for accounts limited to one fixed command.
- Attackerputs a command after a function in a request header
- Web servercopies the header into a variable for a CGI script
- Bashstarts and reads the variable as a function
- Commandruns on the server
Reach and attacks
Bash is part of the base operating system of Linux and macOS, wrote US-CERT, the US government’s computer emergency team, in its alert. Linux alone runs 63.2 % of all websites whose operating system is known today, according to W3Techs. Not every such server could be attacked, though: an attacker needed a path from outside into Bash, such as a CGI script.
No independent study measured how many systems were vulnerable or attacked. All attack counts come from security vendors, and each vendor sees only its own customers, so their numbers cannot be added up:
- Cloudflare, which filters traffic for websites, blocked well over 1.1 million Shellshock attacks by September 30, 2014. At first, it saw 10 to 15 attacks per second.
- Incapsula, a firewall service of Imperva, deflected over 217,089 attempts against over 4,115 websites in the four days after the disclosure. They came from more than 890 IP addresses.
- Cisco’s sensors showed the attacks peaking on September 26, 2014, with another spike two days later.
| First report, September 26 | 725 | |
|---|---|---|
| After four days, September 29 | 1,970 |
Vendor data from Imperva, covering only the websites its service protects. The first value is approximate, the second a minimum.
Most of these attacks were tests. In Cloudflare’s data, about 83 % were reconnaissance: requests that only check whether a server is vulnerable. About 8 % tried to take over the server directly.
| Reconnaissance, testing whether a server is vulnerable | 83 % | |
|---|---|---|
| Direct attempts to take over the server | 8 % |
Vendor data from Cloudflare, September 30, 2014. Both shares are approximate.
Six patches in eleven days
The Bash project released its first patch on the day of the disclosure. It was incomplete. On September 25, a second flaw got its own number, CVE-2014-7169, because Bash still ran trailing text after certain broken function definitions. Researchers then found more flaws in the parser, and the US-CERT alert grew to six CVE numbers by September 30.
| Patch | Date | What it fixed |
|---|---|---|
bash43-025 | September 24, 2014 | The original flaw, CVE-2014-6271 |
bash43-026 | September 26, 2014 | The way around the first patch, CVE-2014-7169 |
bash43-027 | September 27, 2014 | A new way to pass on functions, which closes the whole class of flaws |
bash43-028 | October 1, 2014 | Two memory errors in the parser, CVE-2014-7186 and CVE-2014-7187 |
bash43-029 | October 2, 2014 | A parser flaw that matches CVE-2014-6277 |
bash43-030 | October 5, 2014 | A parser flaw that matches CVE-2014-6278 |
The lasting fix was patch 027. Since then, Bash passes on functions only under special variable names (BASH_FUNC_name%%), so an ordinary variable, such as one filled from a web request, is never treated as code. With it in place, the later parser flaws could no longer be reached through variables. Older Bash versions received matching patches, and Linux distributions shipped them as updates. Red Hat, for example, had tracked the report since September 15, 2014, under embargo: kept secret until a fix was ready.
US-CERT’s alert gave the flaw the highest possible impact rating, 10. Today, the NVD, the US National Vulnerability Database, rates the original flaw 9.8 out of 10 on version 3.1 of the CVSS scale; on the older version 2, all six Shellshock CVEs score 10. CISA, the US cyber agency, added the original flaw and the first bypass to its list of exploited vulnerabilities on January 28, 2022, and one of the later parser flaws, CVE-2014-6278, on October 2, 2025.
Sources
- oss-security: the first public advisory on CVE-2014-6271 openwall.com
- GNU project: the official Bash 4.3 patches, with their dates ftp.gnu.org
- US-CERT alert TA14-268A on Shellshock cisa.gov
- Red Hat Bugzilla: the entry for CVE-2014-6271, tracked under embargo bugzilla.redhat.com
- NVD: CVE-2014-6271 nvd.nist.gov
- Cisco Talos: Shellshock exploits in the wild (vendor data) blogs.cisco.com
- Cloudflare: Inside Shellshock (vendor data) blog.cloudflare.com
- Imperva: The Shellshock Aftermath (vendor data) imperva.com
- W3Techs: usage statistics of Linux w3techs.com
Read next: HeartbleedPrevious: WannaCryOverview: Vulnerabilities