nerdexam
GIAC

GSEC · Question #313

What is a recommended defense against SQL injection, OS injection, and buffer overflows?

The correct answer is B. Validate user input. Input validation is the primary defense that prevents malformed or malicious data from being processed by an application, blocking injection and overflow attacks at the source.

Cloud, Web, and Application Security

Question

What is a recommended defense against SQL injection, OS injection, and buffer overflows?

Options

  • APut in an application layer
  • BValidate user input
  • CUse a secure protocol like HTTPS
  • DUse stored procedures

How the community answered

(27 responses)
  • A
    4% (1)
  • B
    81% (22)
  • C
    4% (1)
  • D
    11% (3)

Why each option

Input validation is the primary defense that prevents malformed or malicious data from being processed by an application, blocking injection and overflow attacks at the source.

APut in an application layer

Adding an application layer does not inherently sanitize data - an application layer can itself be vulnerable if it passes unvalidated input downstream.

BValidate user inputCorrect

SQL injection, OS injection, and buffer overflows all share a common root cause - the application trusts and processes unsanitized user-supplied data without checking it first. Validating input ensures data conforms to expected type, length, and format before it reaches any interpreter or memory buffer. This single control addresses all three attack classes simultaneously.

CUse a secure protocol like HTTPS

HTTPS encrypts data in transit between client and server but does nothing to prevent malicious input from being executed once it arrives at the server.

DUse stored procedures

Stored procedures can reduce SQL injection risk by parameterizing queries, but they do not protect against OS injection or buffer overflows, so they are not a general defense for all three.

Concept tested: Input validation as a defense against injection attacks

Source: https://owasp.org/www-project-cheat-sheets/cheatsheets/Input_Validation_Cheat_Sheet.html

Topics

#SQL injection#input validation#buffer overflow#OS injection

Community Discussion

No community discussion yet for this question.

Full GSEC Practice