Looking for the vulnerability index of Invicti's legacy products?
Bash code injection vulnerability - Vulnerability Database

Bash code injection vulnerability

Description

GNU Bash versions through 4.3 contain a critical code injection vulnerability (Shellshock) that allows attackers to execute arbitrary commands by exploiting how Bash processes environment variables. When Bash parses environment variables containing function definitions, it incorrectly executes any trailing commands after the function definition. This vulnerability can be exploited remotely in various scenarios including CGI scripts, OpenSSH ForceCommand configurations, DHCP clients, and any other service that passes untrusted input through environment variables to Bash across privilege boundaries.

Remediation

Take immediate action to remediate this critical vulnerability:

1. Update Bash immediately
Apply security patches from your operating system vendor to upgrade GNU Bash to a patched version. Use the following commands based on your system:

# Red Hat/CentOS/Fedora
sudo yum update bash

# Debian/Ubuntu
sudo apt-get update && sudo apt-get install --only-upgrade bash

# Verify the patch
bash --version
env x='() { :;}; echo vulnerable' bash -c "echo test"

2. Verify the fix
After updating, the test command above should output only "test" without "vulnerable". If "vulnerable" appears, the system is still at risk.

3. Restart affected services
Restart web servers (Apache, Nginx), SSH daemon, and any other services that invoke Bash scripts:

sudo systemctl restart httpd sshd
# or
sudo service apache2 restart && sudo service ssh restart

4. Additional hardening
• Review and minimize CGI script usage
• Implement Web Application Firewall (WAF) rules to detect exploitation attempts
• Monitor system logs for suspicious environment variable patterns
• Consider using alternative shells where Bash is not required

Related Vulnerabilities