Content deleted Content added
m →Patches: Fix typo |
rvv |
||
(36 intermediate revisions by 24 users not shown) | |||
Line 6:
{{Infobox bug
| name = Shellshock
| image = [[Image:Shellshock-bug.
| caption = A simple Shellshock logo, similar to the [[Heartbleed]] bug logo. <!-- Only one of the logos commonly applied to the bug shall be used here. See the talkpage.-->
| CVE = {{CVE|2014-6271}} (initial),<br/>{{CVE|2014-6277}},<br/> {{CVE|2014-6278}},<br/> {{CVE|2014-7169}},<br/> {{CVE|2014-7186}},<br/> {{CVE|2014-7187}}
Line 16:
}}
'''Shellshock''', also known as '''Bashdoor''',<ref name="NYT-20140925-NP">{{cite news |last=Perlroth |first=Nicole |title=Security Experts Expect 'Shellshock' Software Bug in Bash to Be Significant |url=https://www.nytimes.com/2014/09/26/technology/security-experts-expect-shellshock-software-bug-to-be-significant.html |date=25 September 2014 |work=[[New York Times]] |
On 12 September 2014, Stéphane Chazelas informed Bash's maintainer Chet Ramey<ref name="NYT-20140925-NP" /> of his discovery of the original bug, which he called "Bashdoor". Working with security experts,
The bug Chazelas discovered caused Bash to unintentionally execute commands when the commands are concatenated to the end of [[subroutine|function definitions]] stored in the values of [[environment variable]]s.<ref name="NYT-20140925-NP" /><ref name="TR-20140924">{{cite web |last=Leyden |first=John |title=Patch Bash NOW: 'Shell Shock' bug blasts OS X, Linux systems wide open |url=https://www.theregister.co.uk/2014/09/24/bash_shell_vuln/ |work=[[The Register]] |date=24 September 2014 |
Attackers exploited Shellshock within hours of the initial disclosure by creating [[botnet]]s of compromised computers to perform [[Denial-of-service attack#Distributed attack|distributed denial-of-service attacks]] and [[vulnerability scanner|vulnerability scanning]].<ref name="Wired" /><ref name="IT-20140926-JS" /> Security companies recorded millions of attacks and probes related to the bug in the days following the disclosure.<ref name="NYT-20140926-NP" /><ref name="businessweek" />
Because of the potential to compromise millions of unpatched systems, Shellshock was compared to the [[Heartbleed]] bug in its severity.<ref name="ZDN-20140929" /><ref name="mit-tech">{{cite web |last1=Cerrudo |first1=Cesar |title=Why the Shellshock Bug Is Worse than Heartbleed |url=http://www.technologyreview.com/view/531286/why-the-shellshock-bug-is-worse-than-heartbleed/|date=30 September 2014 |website=[[MIT Technology Review]] |
==Background==
The Shellshock bug affects [[Bash (Unix shell)|Bash]], a program that various [[Unix]]-based systems use to execute command lines and command scripts. It is often installed as the system's default [[command-line interface]]. Analysis of the [[source code]] history of Bash shows the bug was introduced on 5 August 1989, and released in Bash version 1.03 on 1 September 1989.<ref name="BASH105_CHANGELOG">{{cite web |last=Fox |first=Brian |title=Bash 1.05 ChangeLog |url=http://www.oldlinux.org/Linux.old/bin/old/bash-1.05/ChangeLog |date=21 March 1990 |
Shellshock is
The presence of the bug was announced to the public on 2014-09-24, when Bash updates with the fix were ready for distribution,<ref name="seclist-q3-666"
==Reports of attacks==
Within an hour of the announcement of the Bash vulnerability, there were reports of machines being compromised by the bug. By 25 September 2014, [[botnet]]s based on computers compromised with exploits based on the bug were being used by attackers for [[Denial-of-service attack#Distributed attack|distributed denial-of-service]] (DDoS) attacks and [[vulnerability scanner|vulnerability scanning]].<ref name="Wired" /><ref name="IT-20140926-JS" /><ref name="bbconShellshock">{{cite web |author=Various |title=Web attacks build on Shellshock bug |url=
On 26 September, the security firm [[Incapsula]] noted 17,400 attacks on more than 1,800 web domains, originating from 400 unique IP addresses, in the previous 24 hours; 55% of the attacks were coming from China and the United States.<ref name="NYT-20140926-NP">{{cite news |last=Perlroth |first=Nicole |title=Companies Rush to Fix Shellshock Software Bug as Hackers Launch Thousands of Attacks |url=http://bits.blogs.nytimes.com/2014/09/26/companies-rush-to-fix-shellshock-software-bug-as-hackers-launch-thousands-of-attacks/ |date=26 September 2014 |work=[[New York Times]] |
On 6 October, it was widely reported that [[Yahoo!]] servers had been compromised in an attack related to the Shellshock issue.<ref>{{cite news |last=Boren |first=Zachary |title=Shellshock: Romanian hackers are accessing Yahoo servers, claims security expert |url=https://www.independent.co.uk/life-style/gadgets-and-tech/news/shellshock-romanian-hackers-are-accessing-yahoo-servers-claims-security-expert-9777753.html |date=6 October 2014 |work=Independent |
Yet the next day, it was denied that it had been ''Shellshock'' that specifically had allowed these attacks.<ref>{{Cite web|url=http://www.golem.de/news/bash-luecke-yahoo-durch-shellshock-angegriffen-1410-109656.html|work=Golem - IT-News für Profis|
==Specific exploitation vectors==
; CGI-based web server
: When a [[web server]] uses the [[Common Gateway Interface]] (CGI) to handle a document request, it copies certain information from the request into the environment variable list and then delegates the request to a handler program. If the handler is a Bash script, or if it executes
: Security documentation for the widely used [[Apache HTTP Server|Apache]] web server states: "CGI scripts can ... be extremely dangerous if they are not carefully checked,"<ref>{{cite web|url=http://httpd.apache.org/docs/2.2/misc/security_tips.html|title=Apache HTTP Server 2.2 Documentation: Security Tips|
; OpenSSH server
: [[OpenSSH]] has a "ForceCommand" feature, where a fixed command is executed when the user logs in, instead of just running an unrestricted command shell. The fixed command is executed even if the user specified that another command should be run; in that case the original command is put into the environment variable "SSH_ORIGINAL_COMMAND". When the forced command is run in a Bash shell (if the user's shell is set to Bash), the Bash shell will parse the SSH_ORIGINAL_COMMAND environment variable on start-up, and run the commands embedded in it. The user has used their restricted shell access to gain unrestricted shell access, using the Shellshock bug.<ref name="qualys">{{cite web|url=https://blog.qualys.com/laws-of-vulnerabilities/2014/09/24/bash-shellshock-vulnerability|title=The Laws of Vulnerabilities|publisher=Qualys.com|author=Wolfgang Kandek|date=24 September 2014|
; DHCP clients
: Some [[Dynamic Host Configuration Protocol|DHCP]] clients can also pass commands to Bash; a vulnerable system could be attacked when connecting to an open Wi-Fi network. A DHCP client typically requests and gets an IP address from a DHCP server, but it can also be provided a series of additional options. A malicious DHCP server could provide, in one of these options, a string crafted to execute code on a vulnerable workstation or laptop.<ref name="mit-tech"/>
; Qmail server
: When using Bash to process email messages (e.g. through .forward or qmail-alias piping), the [[qmail]] mail server passes external input through in a way that can exploit a vulnerable version of Bash.<ref>
; IBM HMC restricted shell
: The bug can be exploited to gain access to Bash from the [[restricted shell]] of the [[IBM Hardware Management Console]],<ref>
==Reported vulnerabilities==
===Overview===
The maintainer of Bash was warned about the first discovery of the bug on 2014-09-12; a fix followed soon.<ref name="NYT-20140925-NP" /> A few companies and distributors were informed before the matter was publicly disclosed on 2014-09-24 with CVE identifier {{CVE|2014-6271}}.<ref name="seclist-q3-650" /><ref name="seclist-q3-666" /> However, after the release of the patch there were subsequent reports of different, yet related vulnerabilities.<ref name="wheeler-summary">{{cite web | url=http://www.dwheeler.com/essays/shellshock.html | title=Shellshock | date=13 February 2015 |
On 26 September 2014, two open-source contributors, David A. Wheeler and Norihiro Tanaka, noted that there were additional issues, even after patching systems using the most recently available patches. In an email addressed to the oss-sec
On 27 September 2014, [[Michał Zalewski]] from [[Google Inc.]] announced his discovery of other Bash vulnerabilities,<ref name="ITN-20140929">{{cite web |last=Saarinen |first=Juha |title=Further flaws render Shellshock patch ineffective |url=http://www.itnews.com.au/News/396256,further-flaws-render-shellshock-patch-ineffective.aspx |date=29 September 2014 |work=iTnews |
===Initial report (CVE-2014-6271)===
This original form of the vulnerability ({{CVE|2014-6271}}) involves a specially crafted environment variable containing an exported function definition, followed by arbitrary commands. Bash incorrectly executes the trailing commands when it imports the function.<ref name="nvd6271">{{cite web|url=http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-6271|title=Vulnerability Summary for CVE-2014-6271|publisher=NIST|date=4 October 2014|
<syntaxhighlight lang="bash">env x='() { :;}; echo vulnerable' bash -c "echo this is a test"</syntaxhighlight>
In systems affected by the vulnerability, the above commands will display the word "vulnerable" as a result of Bash executing the command '''''"echo vulnerable"''''', which was embedded into the specially crafted environment variable named '''''"x"'''''.<ref name="zdnet-betterbash" /><ref>{{cite web|url=https://securityblog.redhat.com/2014/09/24/bash-specially-crafted-environment-variables-code-injection-attack/|title=Bash specially-crafted environment variables code injection attack|work=Red Hat Security|
===CVE-2014-6277 ===
Discovered by [[Michał Zalewski]],<ref name="ITN-20140929" /><ref name="HH-20140928" /><ref name="NIST-20140927">{{cite web |author=Staff |title=National Cyber Awareness System Vulnerability Summary for CVE-2014-6277 |url=https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-6277 |date=27 September 2014 |work=[[National Institute of Standards and Technology]] |
===CVE-2014-6278===
Also discovered by [[Michał Zalewski]],<ref name="PCW-20140929" /><ref>{{cite web |author=Staff |title=National Cyber Awareness System Vulnerability Summary for CVE-2014-6278 |url=https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-6278 |date=30 September 2014 |work=[[National Institute of Standards and Technology]] |
===CVE-2014-7169===
On the same day the original vulnerability was published, [[Tavis Ormandy]] discovered this related bug ({{CVE|2014-7169}}),<ref name="qualys" /> which is
demonstrated in the following code:
Line 107:
===CVE-2014-7186===
Florian Weimer and Todd Sabin found this bug ({{CVE|2014-7186}}),<ref name="zdnet-betterbash">{{cite web|last1=Vaughan-Nichols|first1=Steven|title=Shellshock: Better 'bash' patches now available|url=
An example of the vulnerability, which leverages the use of multiple "<<EOF" declarations (nested [[Here document|"here documents"]]):
Line 117:
===CVE-2014-7187===
Also found by Florian Weimer,<ref name="zdnet-betterbash" /> {{CVE|2014-7187}} is an [[off-by-one error]] in the Bash parser code, allowing out-of-bounds memory access.<ref>{{cite web |author=Staff |title=National Cyber Awareness System Vulnerability Summary for CVE-2014-7187 |url=https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-7187 |date=29 September 2014 |work=[[National Institute of Standards and Technology]] |
An example of the vulnerability, which leverages the use of multiple "done" declarations:
Line 129:
== Patches ==
Until 24 September 2014, Bash maintainer Chet Ramey provided a patch version bash43-025 of Bash 4.3 addressing CVE-2014-6271,<ref>{{cite web
|url=http://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-025 |title=BASH PATCH REPORT
}}</ref> which was already packaged by distribution maintainers. On 24 September, bash43-026 followed, addressing CVE-2014-7169.<ref>{{cite web
|url=http://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-026 |title=BASH PATCH REPORT
}}</ref>
Then CVE-2014-7186 was discovered. Florian Weimer from [[Red Hat]] posted some patch code for this "unofficially" on 25 September,<ref>{{cite web |url=http://www.openwall.com/lists/oss-security/2014/09/25/13 |title=Re: CVE-2014-6271: remote code execution through bash |last=Weimer |first=Florian |date=25 September 2014 |website=[[Openwall Project]] |
}}</ref>
which Ramey incorporated into Bash as bash43-027.<ref>{{cite web
|url=http://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-027 |title=BASH PATCH REPORT
}}</ref><ref>{{cite web
| last=Gallagher | first=Sean | title=New "Shellshock" patch rushed out to resolve gaps in first fix [Updated] |date=26 September 2014 |
The next day, Red Hat officially presented according updates for [[Red Hat Enterprise Linux]],<ref>{{cite web |url=https://rhn.redhat.com/errata/RHSA-2014-1306.html |title=Important: bash security update
}}</ref><ref name="rh-art">{{cite web
|url=https://access.redhat.com/articles/1200223 |title=Bash Code Injection Vulnerability via Specially Crafted Environment Variables (CVE-2014-6271, CVE-2014-7169)
}}</ref> after another day for [[Fedora (operating system)|Fedora 21]].<ref>{{cite web
|url=https://lists.fedoraproject.org/pipermail/package-announce/2014-September/139129.html |title=[SECURITY] Fedora 21 Update: bash-4.3.25-2.fc21
}}</ref>
[[Canonical Ltd.]] presented updates for its [[Ubuntu (operating system)|Ubuntu]] ''Long Term Support'' versions on Saturday, 27 September;<ref>{{cite web
|url=http://www.ubuntu.com/usn/usn-2364-1/ |title=USN-2364-1: Bash vulnerabilities
}}</ref>
on Sunday, there were updates for [[SUSE Linux Enterprise]].<ref>{{cite web
|url=http://lists.opensuse.org/opensuse-security-announce/2014-09/msg00042.html |title=SUSE Security Update: Security update for bash
}}</ref>
The following Monday and Tuesday at the end of the month, [[
On 1 October 2014, [[Michał Zalewski]] from [[Google Inc.]] finally stated that Weimer's code and bash43-027 had fixed not only the first three bugs but even the remaining three that were published after bash43-027, including his own two discoveries.<ref name="lcamtuf-oct-1" /> This means that after the earlier distribution updates, no other updates have been required to cover all the six issues.<ref name="rh-art" />
Line 165:
{{Portal|Internet}}
* [[National Institute of Standards and Technology|NIST]] [http://nvd.nist.gov/home.cfm National Vulnerability Database] {{Webarchive|url=https://web.archive.org/web/20110925095556/http://nvd.nist.gov/home.cfm |date=25 September 2011 }} & [[Common Vulnerabilities and Exposures|CVE]] [http://cve.mitre.org Common Vulnerabilities and Exposures]
** CVE-2014-6271 - [https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-6271 20140924nist] & [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-6271 20140909cve] (first bug)
** CVE-2014-6277 - [https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-6277 20140927nist] & [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-6277 20140909cve]
Line 177:
* [http://www.oracle.com/technetwork/topics/security/alert-cve-2014-7169-2303276.html Security Alert for CVE-2014-7169] at [[Oracle Corporation|Oracle]]
* [http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2090740 "VMware remediation of Bash Code Injection Vulnerability via Specially Crafted Environment Variables"] at [[VMware]]
* [https://www.cyberwatch.fr/en/vulnerabilities Cyberwatch Vulnerabilities Database] {{Webarchive|url=https://web.archive.org/web/20180822211959/https://www.cyberwatch.fr/en/vulnerabilities |date=22 August 2018 }}
** [https://www.cyberwatch.fr/en/vulnerabilities/CVE-2014-6271 CVE-2014-6271]
** [https://www.cyberwatch.fr/en/vulnerabilities/CVE-2014-6277 CVE-2014-6277]
Line 192:
[[Category:Internet security]]
[[Category:Software bugs]]
[[Category:Computer security exploits]]
|