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.
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)- A12% (7)
- B5% (3)
- C80% (47)
- D3% (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.
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.
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.
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.
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
Community Discussion
No community discussion yet for this question.