nerdexam
EC-Council

312-50V11 · Question #1023

CyberTech Inc. recently experienced SQL injection attacks on its official website. The company appointed Bob, a security professional, to build and incorporate defensive strategies against such…

The correct answer is C. Whitelist validation. This question tests knowledge of input validation strategies used to prevent SQL injection attacks. Whitelist validation - also called allowlist validation - permits only pre-approved values, data types, ranges, and sizes, rejecting everything else by default.

SQL Injection

Question

CyberTech Inc. recently experienced SQL injection attacks on its official website. The company appointed Bob, a security professional, to build and incorporate defensive strategies against such attacks. Bob adopted a practice whereby only a list of entities such as the data type, range, size, and value, which have been approved for secured access, is accepted. What is the defensive technique employed by Bob in the above scenario?

Options

  • AOutput encoding
  • BEnforce least privileges
  • CWhitelist validation
  • DBlacklist validation

How the community answered

(27 responses)
  • A
    4% (1)
  • B
    4% (1)
  • C
    93% (25)

Why each option

This question tests knowledge of input validation strategies used to prevent SQL injection attacks. Whitelist validation - also called allowlist validation - permits only pre-approved values, data types, ranges, and sizes, rejecting everything else by default.

AOutput encoding

Output encoding transforms data when it is rendered to prevent injection in the output context such as HTML or JavaScript, but it does not validate or restrict the incoming input values before processing.

BEnforce least privileges

Enforcing least privileges limits the database account permissions to reduce the impact of a successful attack, but it does not prevent malicious input from being submitted or processed.

CWhitelist validationCorrect

Whitelist validation defines an explicit set of approved inputs - including acceptable data types, value ranges, sizes, and formats - and rejects any input that does not conform to these approved criteria. This is highly effective against SQL injection because malicious SQL metacharacters and payloads are not in the approved list and are therefore blocked before reaching the database layer. It is a proactive defense that assumes all input is untrusted unless it matches a known-good pattern.

DBlacklist validation

Blacklist validation attempts to block known bad characters or patterns and is weaker than whitelisting because attackers can encode or obfuscate payloads to bypass the blocked list.

Concept tested: Whitelist input validation against SQL injection

Source: https://cheatsheetseries.owasp.org/cheatsheets/Input_Validation_Cheat_Sheet.html

Topics

#whitelist validation#input validation#SQL injection defense#web security

Community Discussion

No community discussion yet for this question.

Full 312-50V11 Practice