210-250 · Question #54
If a web server accepts input from the user and passes it to a bash shell, to which attack method is it vulnerable?
The correct answer is C. command injection. When a web server passes unsanitized user input directly to a shell interpreter, an attacker can inject arbitrary OS commands that execute with the server's privileges.
Question
If a web server accepts input from the user and passes it to a bash shell, to which attack method is it vulnerable?
Options
- Ainput validation
- Bhash collision
- Ccommand injection
- Dinteger overflow
How the community answered
(19 responses)- B5% (1)
- C89% (17)
- D5% (1)
Why each option
When a web server passes unsanitized user input directly to a shell interpreter, an attacker can inject arbitrary OS commands that execute with the server's privileges.
Input validation is a defensive control or category of vulnerability, not an attack method itself.
Hash collision attacks target cryptographic hash functions to find two inputs with the same hash output, unrelated to shell execution.
Command injection occurs when user-supplied data is passed to a system shell without sanitization, allowing an attacker to append or substitute malicious commands (e.g., using semicolons or pipes). Because the shell interprets the injected text as a legitimate command, the attacker can read files, exfiltrate data, or gain a shell. This is the direct technical consequence of passing user input to bash without validation or escaping.
Integer overflow is a memory/arithmetic vulnerability caused by exceeding the maximum value a data type can hold, not related to shell input handling.
Concept tested: OS command injection via unsanitized shell input
Source: https://owasp.org/www-community/attacks/Command_Injection
Topics
Community Discussion
No community discussion yet for this question.