A penetration test of a client's order portal shows that a search parameter is concatenated into a SQL statement. The statement runs under a database account with administrative rights. Which three changes best remediate the injection risk? (Choose three.)
Choose 3 answers
Show the answer
Correct answersA. A database account limited to the tables and actions the app needsB. Parameterized queries that keep input separate from SQL codeC. Server-side allow-list validation of the parameter's expected format
AWhy this is right: Least privilege limits what injected SQL can read or change, even if one gets through.
BWhy this is right: Binding input as data means it is never parsed as SQL, which removes the root cause.
CWhy this is right: Rejecting input that does not match the expected format cuts off many injection payloads.
DWhy not this: These tokens counter cross-site request forgery, not attacker input altering a query.
EWhy not this: Output encoding stops cross-site scripting in the page; it does not stop input from changing the SQL statement.
FWhy not this: Encryption at rest protects stolen storage media, but injected queries run through the app and read decrypted data.
Parameterized queries stop input from being parsed as SQL, allow-list validation rejects unexpected input, and a least-privilege account limits the damage of any injection that gets through. Anti-forgery tokens defend against cross-site request forgery and do nothing to stop input being interpreted as SQL.