What is SQL injection?
- A.A way to encrypt data in a database; command injection is stopped by escaping output rather than input
- B.An attack where malicious SQL code is inserted into input fields to manipulate a database
- C.A method of optimizing database queries, since parameterised queries concatenate user input into the SQL string
- D.A tool for backing up SQL databases
Why B is correct
SQL injection occurs when an attacker inserts malicious SQL statements into input fields (like login forms or search boxes) that are passed directly to a database query. This can allow attackers to bypass authentication, read sensitive data, modify or delete records, and even execute system commands.
Know someone studying for Security Fundamentals? Send them this one.