Anatomy of a Breach

Anatomy of a Breach: Shellshock — The 25-Year-Old Bash Bug That Threatened Billions of Devices

> series: anatomy_of_a_breach —— part: 070 —— vulnerability: cve-2014-6271 —— age: 25_years —— affected: billions_of_devices<span class="cursor-blink">_</span>_

Hedgehog Security 31 October 2014 13 min read

A 25-year-old bug in the shell. Billions of devices at risk.

On 24 September 2014, CVE-2014-6271 was publicly disclosed — a critical vulnerability in GNU Bash, the default command-line shell on virtually every Linux, Unix, and macOS system in the world. The bug, dubbed 'Shellshock', had been present in Bash since version 1.03, released in September 1989 — meaning it had existed undetected for 25 years. The vulnerability allowed an attacker to append arbitrary commands to environment variables, which Bash would execute when invoked — enabling remote code execution on any system where Bash was accessible through a network service.

The impact was staggering in scope. US-CERT issued an emergency alert rated at the maximum severity. Web servers running CGI scripts, SSH servers, DHCP clients, mail servers, and countless embedded devices — from routers and network appliances to IoT devices and industrial control systems — were potentially vulnerable. Unlike Heartbleed (which allowed memory disclosure), Shellshock allowed direct command execution — enabling attackers to install malware, create backdoors, steal data, or take complete control of vulnerable systems. Automated exploitation began within hours of disclosure.


Recommended

Not sure where to start?

We'll scope your test for free and tell you exactly what you need. No obligation, no hard sell.

Free Scoping Call

Environment variables as code execution vectors.

Shellshock — Exploitation Example (Simplified)
# Normal environment variable:
VAR="hello world"

# Shellshock exploit — appending command to function definition:
VAR='() { :; }; /bin/cat /etc/passwd'

# Bash executes /bin/cat /etc/passwd when processing the variable
# Any command can be substituted — malware download, backdoor, etc.

# Web server exploitation via CGI:
curl -A '() { :; }; /bin/bash -c "cat /etc/passwd"' http://target/cgi-bin/script
# The User-Agent header becomes an environment variable
# Bash processes it and executes the appended command

25 years old, everywhere, and trivially exploitable.

Ubiquitous Deployment
Bash is the default shell on virtually every Linux and Unix system — from web servers and cloud instances to routers, NAS devices, and embedded systems. The attack surface was measured in billions of devices. Our <a href="/vulnerability-scanning">vulnerability scanning</a> identifies Shellshock-vulnerable systems across your infrastructure.
Remote Code Execution
Shellshock allowed arbitrary command execution — the most severe category of vulnerability. An attacker could install rootkits, create persistent backdoors, exfiltrate data, or pivot to other systems on the network. Our <a href="/penetration-testing/infrastructure">infrastructure penetration testing</a> assesses the exploitability of command injection vulnerabilities.
IoT and Embedded Devices
Many embedded devices — routers, network appliances, printers, cameras — run Bash and cannot be easily patched. Some may never receive patches from their manufacturers. These 'forever vulnerable' devices persist in networks indefinitely. <a href="https://www.socinabox.co.uk">SOC in a Box</a> monitors for exploitation attempts against known vulnerable devices.
25 Years Undetected
Like <a href="/blog/anatomy-of-a-breach-heartbleed">Heartbleed's</a> two years, Shellshock's 25-year latency demonstrated that critical vulnerabilities can hide in widely-used software for decades. Code review, fuzzing, and security testing of infrastructure components — not just applications — are essential. <a href="/cyber-essentials">Cyber Essentials Danzell</a> mandates 14-day critical patching to close these vulnerabilities once disclosed.

Patch immediately. Monitor everything. Test continuously.

Shellshock required the same response as Heartbleed: immediate patching of all vulnerable systems, monitoring for exploitation attempts, and assessment of whether the vulnerability had been exploited before patch deployment. For systems that could not be patched (embedded devices, legacy systems), compensating controls — network segmentation, WAF rules, and monitoring — were required.

Cyber Essentials Danzell mandates that critical patches are applied within 14 days — a control that addresses Shellshock directly. Our vulnerability scanning identifies Shellshock-vulnerable systems. Infrastructure penetration testing validates that patches have been applied and that compensating controls are effective for systems that cannot be patched. SOC in a Box monitors for Shellshock exploitation attempts. And UK Cyber Defence provides incident response when exploitation is detected.


Shellshock hid for 25 years. Heartbleed hid for two. What is hiding in your infrastructure?

<a href="/vulnerability-scanning">Vulnerability scanning</a> finds what is hiding. <a href="/penetration-testing/infrastructure">Penetration testing</a> validates patches. <a href="/cyber-essentials">Cyber Essentials</a> mandates 14-day critical patching.

Next Step

Not sure where to start?

We'll scope your test for free and tell you exactly what you need. No obligation, no hard sell.

Free Scoping Call

Related Articles