nerdexam
Cisco

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.

Threats and Vulnerabilities

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)
  • B
    5% (1)
  • C
    89% (17)
  • D
    5% (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.

Ainput validation

Input validation is a defensive control or category of vulnerability, not an attack method itself.

Bhash collision

Hash collision attacks target cryptographic hash functions to find two inputs with the same hash output, unrelated to shell execution.

Ccommand injectionCorrect

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.

Dinteger overflow

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

#command injection#web vulnerabilities#input validation#bash shell

Community Discussion

No community discussion yet for this question.

Full 210-250 Practice