Remote Code Execution - Shell Shock
ID |
remote_code_execution_shell_shock |
Severity |
critical |
Kind |
Remote Code Execution |
CWE |
78 |
Description
The server is running a version of the Bash shell vulnerable to CVE-2014-6271, commonly known as Shellshock. This vulnerability allows remote attackers to execute arbitrary operating system commands by exploiting how Bash processes environment variables in CGI scripts and other server-side contexts.
Rationale
Shellshock exploits a flaw in how Bash parses environment variables containing function definitions, allowing attackers to append arbitrary commands after the function definition. When vulnerable CGI scripts pass HTTP headers to Bash as environment variables, attackers can inject malicious commands through User-Agent, Referer, or other controllable headers. This results in immediate remote code execution with the privileges of the web server, enabling complete system compromise, data exfiltration, or installation of persistent backdoors.
Remediation
Update Bash on the server to the latest patched version that addresses CVE-2014-6271 and related Shellshock variants. Additionally, review and minimize the use of CGI scripts, consider migrating to safer alternatives like FastCGI or application servers, and implement web application firewall rules to block suspicious HTTP headers.