nerdexam
GIAC

GSEC · Question #331

A system administrator sees the following URL in the webserver logs: Which action will mitigate against this attack?

The correct answer is C. Filter potentially harmful characters from user input. The URL in the logs shows a SQL injection attempt, and sanitizing user input is the direct control that blocks this attack vector.

Cloud, Web, and Application Security

Question

A system administrator sees the following URL in the webserver logs:

Which action will mitigate against this attack?

Options

  • AForce all web applications to use SSL/US
  • BEncode web traffic using Base64 before transmission
  • CFilter potentially harmful characters from user input
  • DAuthenticate users before allowing database queries

How the community answered

(59 responses)
  • A
    12% (7)
  • B
    5% (3)
  • C
    80% (47)
  • D
    3% (2)

Why each option

The URL in the logs shows a SQL injection attempt, and sanitizing user input is the direct control that blocks this attack vector.

AForce all web applications to use SSL/US

SSL/TLS secures data confidentiality in transit but provides no protection against injection payloads that arrive over an encrypted channel and are processed by the application.

BEncode web traffic using Base64 before transmission

Base64 is a data encoding scheme, not a security sanitization mechanism, and does not prevent injected SQL characters from reaching and being interpreted by the database.

CFilter potentially harmful characters from user inputCorrect

SQL injection succeeds when user-supplied data is concatenated into a database query without sanitization, allowing characters like single quotes and SQL keywords to alter query logic. Filtering or encoding potentially harmful characters on the server side - before input reaches the query engine - neutralizes the attack by ensuring user data is treated strictly as data, not as executable SQL syntax.

DAuthenticate users before allowing database queries

Requiring authentication controls who submits requests but does not validate or sanitize the content of those requests, so authenticated users can still submit malicious SQL payloads.

Concept tested: SQL injection prevention through input sanitization

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

Topics

#web attack#input filtering#injection attack#URL manipulation

Community Discussion

No community discussion yet for this question.

Full GSEC Practice