ExamGecko
Question list
Search
Search

Related questions











Question 328 - 200-201 discussion

Report
Export

How is SQL injection prevented?

A.

Address space layout randomization

Answers
A.

Address space layout randomization

B.

Validate and sanitize user input

Answers
B.

Validate and sanitize user input

C.

...in the web server as a nonprivileged user

Answers
C.

...in the web server as a nonprivileged user

D.

...cost profiling

Answers
D.

...cost profiling

Suggested answer: B

Explanation:

SQL injection is a type of injection attack where malicious SQL statements are inserted into an entry field for execution.

The primary way to prevent SQL injection is by validating and sanitizing user input. This involves checking the input for malicious content and ensuring it adheres to expected patterns.

Prepared statements (parameterized queries) are also highly effective, as they treat user input as data rather than executable code.

Implementing these practices ensures that any input received from users does not manipulate SQL queries in a harmful way.

OWASP SQL Injection Prevention Cheat Sheet

Best Practices for Input Validation and Sanitization

Secure Coding Guidelines

asked 07/10/2024
Thijs van Ham
36 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first