Question 1 · Difficulty 2/5
Which of the following best describes the primary mechanism of a SQL injection (SQLi) attack? (Select the best answer.)
Show answer & explanation
Correct answer: B
Inserting attacker-controlled SQL syntax into an application query to manipulate the database
SQL injection works by embedding attacker-supplied SQL syntax into a query the application passes to the database, causing the database to execute unintended commands such as bypassing authentication, dumping tables, or deleting data. Injecting script tags into a page describes cross-site scripting (XSS), not SQLi. Overwriting adjacent memory describes a buffer overflow. Intercepting and modifying HTTP traffic in transit describes an on-path (man-in-the-middle) attack.