# CVE-2014-6271 (Shellshock): GNU Bourne-Again Shell (Bash) Arbitrary Code Execution

> Remote attackers can execute arbitrary code via crafted environment variables in GNU Bash, affecting systems using Bash for CGI, SSH, or DHCP.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Yes, since 28 Jan 2022 (CISA KEV)
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 24 Sep 2014
- **Updated:** 22 Oct 2025
- **Also known as:** CVE-2014-3671, CVE-2014-62771, CVE-2014-7227, DEBIAN-CVE-2014-6271, DLA-59-1, DSA-3032-1, GHSA-6hfc-grwp-2p9c, MGASA-2014-0388, RHSA-2014:1293, RHSA-2014:1294, RHSA-2014:1295, UBUNTU-CVE-2014-6271, USN-2362-1

## What is CVE-2014-6271?

CVE-2014-6271 (Shellshock) is a critical command injection vulnerability in Apple Mac Os X, published on 24 Sep 2014. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

GNU Bash through 4.3 processes trailing strings after function definitions in the values of environment variables, which allows remote attackers to execute arbitrary code via a crafted environment, as demonstrated by vectors involving the ForceCommand feature in OpenSSH sshd, the mod_cgi and mod_cgid modules in the Apache HTTP Server, scripts executed by unspecified DHCP clients, and other situations in which setting the environment occurs across a privilege boundary from Bash execution, aka "ShellShock."  NOTE: the original fix for this issue was incorrect; CVE-2014-7169 has been assigned to cover the vulnerability that is still present after the incorrect fix.

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command)

## Which versions are affected by CVE-2014-6271?

It affects 74 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `bash` | Red Hat:enterprise_linux:5::client | All versions | 0:3.2-33.el5.1 |
| `bash-debuginfo` | Red Hat:enterprise_linux:5::client | All versions | 0:3.2-33.el5.1 |
| `bash` | Red Hat:enterprise_linux:5::server | All versions | 0:3.2-33.el5.1 |
| `bash-debuginfo` | Red Hat:enterprise_linux:5::server | All versions | 0:3.2-33.el5.1 |
| `bash` | Red Hat:enterprise_linux:6::client | All versions | 0:4.1.2-15.el6_5.1 |
| `bash-debuginfo` | Red Hat:enterprise_linux:6::client | All versions | 0:4.1.2-15.el6_5.1 |
| `bash-doc` | Red Hat:enterprise_linux:6::client | All versions | 0:4.1.2-15.el6_5.1 |
| `bash` | Red Hat:enterprise_linux:6::computenode | All versions | 0:4.1.2-15.el6_5.1 |
| `bash-debuginfo` | Red Hat:enterprise_linux:6::computenode | All versions | 0:4.1.2-15.el6_5.1 |
| `bash-doc` | Red Hat:enterprise_linux:6::computenode | All versions | 0:4.1.2-15.el6_5.1 |
| `bash` | Red Hat:enterprise_linux:6::server | All versions | 0:4.1.2-15.el6_5.1 |
| `bash-debuginfo` | Red Hat:enterprise_linux:6::server | All versions | 0:4.1.2-15.el6_5.1 |
| `bash-doc` | Red Hat:enterprise_linux:6::server | All versions | 0:4.1.2-15.el6_5.1 |
| `bash` | Red Hat:enterprise_linux:6::workstation | All versions | 0:4.1.2-15.el6_5.1 |
| `bash-debuginfo` | Red Hat:enterprise_linux:6::workstation | All versions | 0:4.1.2-15.el6_5.1 |
| `bash-doc` | Red Hat:enterprise_linux:6::workstation | All versions | 0:4.1.2-15.el6_5.1 |
| `bash` | Red Hat:enterprise_linux:7::client | All versions | 0:4.2.45-5.el7_0.2 |
| `bash-debuginfo` | Red Hat:enterprise_linux:7::client | All versions | 0:4.2.45-5.el7_0.2 |
| `bash-doc` | Red Hat:enterprise_linux:7::client | All versions | 0:4.2.45-5.el7_0.2 |
| `bash` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.2.45-5.el7_0.2 |
| `bash-debuginfo` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.2.45-5.el7_0.2 |
| `bash-doc` | Red Hat:enterprise_linux:7::computenode | All versions | 0:4.2.45-5.el7_0.2 |
| `bash` | Red Hat:enterprise_linux:7::server | All versions | 0:4.2.45-5.el7_0.2 |
| `bash-debuginfo` | Red Hat:enterprise_linux:7::server | All versions | 0:4.2.45-5.el7_0.2 |
| `bash-doc` | Red Hat:enterprise_linux:7::server | All versions | 0:4.2.45-5.el7_0.2 |
| `bash` | Red Hat:enterprise_linux:7::workstation | All versions | 0:4.2.45-5.el7_0.2 |
| `bash-debuginfo` | Red Hat:enterprise_linux:7::workstation | All versions | 0:4.2.45-5.el7_0.2 |
| `bash-doc` | Red Hat:enterprise_linux:7::workstation | All versions | 0:4.2.45-5.el7_0.2 |
| `bash` | Red Hat:rhel_els:4::as | All versions | 0:3.0-27.el4.2 |
| `bash-debuginfo` | Red Hat:rhel_els:4::as | All versions | 0:3.0-27.el4.2 |
| `bash` | Red Hat:rhel_els:4::es | All versions | 0:3.0-27.el4.2 |
| `bash-debuginfo` | Red Hat:rhel_els:4::es | All versions | 0:3.0-27.el4.2 |
| `bash` | Red Hat:rhel_eus:5.9 | All versions | 0:3.2-32.el5_9.2 |
| `bash-debuginfo` | Red Hat:rhel_eus:5.9 | All versions | 0:3.2-32.el5_9.2 |
| `bash` | Red Hat:rhel_eus:6.4::computenode | All versions | 0:4.1.2-15.el6_4.1 |
| `bash-debuginfo` | Red Hat:rhel_eus:6.4::computenode | All versions | 0:4.1.2-15.el6_4.1 |
| `bash-doc` | Red Hat:rhel_eus:6.4::computenode | All versions | 0:4.1.2-15.el6_4.1 |
| `bash` | Red Hat:rhel_eus:6.4::server | All versions | 0:4.1.2-15.el6_4.1 |
| `bash-debuginfo` | Red Hat:rhel_eus:6.4::server | All versions | 0:4.1.2-15.el6_4.1 |
| `bash-doc` | Red Hat:rhel_eus:6.4::server | All versions | 0:4.1.2-15.el6_4.1 |

Products: Apple Mac Os X, Arista Eos, Canonical Ubuntu Linux, Checkpoint Security Gateway, Citrix Netscaler Sdx Firmware, Debian Debian Linux, F5 Arx Firmware, F5 Big-Ip Access Policy Manager, F5 Big-Ip Advanced Firewall Manager, F5 Big-Ip Analytics, F5 Big-Ip Application Acceleration Manager, F5 Big-Ip Application Security Manager, F5 Big-Ip Edge Gateway, F5 Big-Ip Global Traffic Manager, F5 Big-Ip Link Controller, F5 Big-Ip Local Traffic Manager, F5 Big-Ip Policy Enforcement Manager, F5 Big-Ip Protocol Security Module, F5 Big-Ip Wan Optimization Manager, F5 Big-Ip Webaccelerator and 54 more.

## How do I fix CVE-2014-6271?

Apply the vendor's patch. US federal agencies must fix it by 28 Jul 2022.

## Is CVE-2014-6271 being exploited?

Yes. Attackers have exploited CVE-2014-6271 in the wild since at least 28 Jan 2022.

Public exploit code:

- Shellshock exploit + vulnerable environment (github_poc): https://github.com/opsxcq/exploit-CVE-2014-6271
- Python Scanner for "ShellShock" (CVE-2014-6271) (github_poc): https://github.com/scottjpack/shellshock_scanner
- Vulnerability as a service: showcasing CVS-2014-6271, a.k.a. Shellshock (github_poc): https://github.com/hmlio/vaas-cve-2014-6271
- Shellshock exploit aka CVE-2014-6271 (github_poc): https://github.com/b4keSn4ke/CVE-2014-6271
- shellshock CVE-2014-6271 CGI Exploit,  Use like Openssh via CGI (github_poc): https://github.com/cj1324/CGIShell
- A python script to enumerate CGI scripts vulnerable to CVE-2014-6271 on one specific server (github_poc): https://github.com/francisck/shellshock-cgi

## Other vulnerabilities in Apple Mac Os X

- [CVE-2014-7169](https://insights.sbomify.com/CVE-2014-7169/): GNU Bourne-Again Shell (Bash) Arbitrary Code Execution (critical 9.8, exploited in the wild)
- [CVE-2012-1823](https://insights.sbomify.com/CVE-2012-1823/): PHP-CGI Query String Parameter (critical 9.8, exploited in the wild)
- [CVE-2021-30713](https://insights.sbomify.com/CVE-2021-30713/): Apple macOS Unspecified (high 7.8, exploited in the wild)
- [CVE-2019-8526](https://insights.sbomify.com/CVE-2019-8526/): Apple macOS Use-After-Free (high 7.8, exploited in the wild)
- [CVE-2015-1130](https://insights.sbomify.com/CVE-2015-1130/): Apple OS X Authentication Bypass (high 7.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2014-6271 (Shellshock) and fix it if it is affected.

What it is: CVE-2014-6271 (Shellshock) is a critical command injection vulnerability in Apple Mac Os X, published on 24 Sep 2014. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: Yes. Attackers have exploited CVE-2014-6271 in the wild since at least 28 Jan 2022.

Affected product: Apple Mac Os X. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2014-6271/ (Markdown: https://insights.sbomify.com/CVE-2014-6271/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2014-6271
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2014-6271
- OSV: https://osv.dev/vulnerability/CVE-2014-6271

---
From sbomify Insights: https://insights.sbomify.com/CVE-2014-6271/
Summaries are generated and may contain mistakes; the official description above is the record.
