Which vulnerability affected the GNU Bash shell due to crafted environment variables?

Prepare for the Certified Ethical Hacker Version 11 Exam with a comprehensive test featuring flashcards and multiple choice questions, each accompanied by hints and explanations to ensure a thorough understanding. Ace your ethical hacking exam with confidence!

Multiple Choice

Which vulnerability affected the GNU Bash shell due to crafted environment variables?

Explanation:
The concept tested is how Bash processes function definitions passed through the environment and how that can be abused to run arbitrary commands. In the Shellshock vulnerability, Bash allowed environment variables that define shell functions to be exported to child processes. If an environment string contained a function definition followed by additional commands, Bash could evaluate the function and then execute the embedded payload. This meant an attacker could trigger code execution on systems where Bash stored or imported such environment data, especially in contexts like CGI scripts where user-controlled environment variables are passed to shell processes. A typical demonstration shows crafting an environment variable with a function signature and then a command to run, and executing a vulnerable Bash would cause that command to run, giving the attacker control. Patches and mitigations involve updating Bash to the fixed version and, in the meantime, restricting or sanitizing environment exports or CGI usage to prevent untrusted input from reaching Bash. Other options describe unrelated vulnerabilities: Heartbleed targets OpenSSL’s heartbeat handling, Spectre concerns CPU speculative execution flaws, and Kr00k involves weaknesses in WPA2 key handling.

The concept tested is how Bash processes function definitions passed through the environment and how that can be abused to run arbitrary commands. In the Shellshock vulnerability, Bash allowed environment variables that define shell functions to be exported to child processes. If an environment string contained a function definition followed by additional commands, Bash could evaluate the function and then execute the embedded payload. This meant an attacker could trigger code execution on systems where Bash stored or imported such environment data, especially in contexts like CGI scripts where user-controlled environment variables are passed to shell processes.

A typical demonstration shows crafting an environment variable with a function signature and then a command to run, and executing a vulnerable Bash would cause that command to run, giving the attacker control. Patches and mitigations involve updating Bash to the fixed version and, in the meantime, restricting or sanitizing environment exports or CGI usage to prevent untrusted input from reaching Bash.

Other options describe unrelated vulnerabilities: Heartbleed targets OpenSSL’s heartbeat handling, Spectre concerns CPU speculative execution flaws, and Kr00k involves weaknesses in WPA2 key handling.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy