nerdexam
EC-Council

312-50V11 · Question #22

Code injection is a form of attack in which a malicious user:

The correct answer is A. Inserts text into a data field that gets interpreted as code. Code injection occurs when attacker-supplied text entered into a data field is interpreted and executed as code by the application or underlying system. This is distinct from memory exploits, client-side scripting attacks, or direct file system access.

Hacking Web Applications

Question

Code injection is a form of attack in which a malicious user:

Options

  • AInserts text into a data field that gets interpreted as code
  • BGets the server to execute arbitrary code using a buffer overflow
  • CInserts additional code into the JavaScript running in the browser
  • DGains access to the codebase on the server and inserts new code

How the community answered

(55 responses)
  • A
    87% (48)
  • B
    7% (4)
  • C
    4% (2)
  • D
    2% (1)

Why each option

Code injection occurs when attacker-supplied text entered into a data field is interpreted and executed as code by the application or underlying system. This is distinct from memory exploits, client-side scripting attacks, or direct file system access.

AInserts text into a data field that gets interpreted as codeCorrect

In a code injection attack, a malicious user inputs a string into a data field (such as a form input, URL parameter, or API call) that the application fails to sanitize, causing the backend to parse and execute the input as code. Classic examples include SQL injection, LDAP injection, and OS command injection, where the injected text alters the intended logic of a query or command.

BGets the server to execute arbitrary code using a buffer overflow

Executing arbitrary code via a buffer overflow is a memory corruption exploit, not code injection through a data field.

CInserts additional code into the JavaScript running in the browser

Inserting code into JavaScript running in the browser describes Cross-Site Scripting (XSS), which is a client-side injection attack distinct from server-side code injection.

DGains access to the codebase on the server and inserts new code

Gaining access to the server codebase and inserting new code describes unauthorized code modification or a supply chain attack, not code injection.

Concept tested: Code injection attack definition and mechanism

Source: https://owasp.org/www-community/attacks/Code_Injection

Topics

#code injection#input validation#web vulnerabilities#data field injection

Community Discussion

No community discussion yet for this question.

Full 312-50V11 Practice