mediumMultiple Choice
SSCP Practice Question: A database administrator notices unusual queries…
A database administrator notices unusual queries that seem to be trying to extract data via SQL injection. The application uses parameterized queries for most queries, but some dynamic queries are built using string concatenation. What is the BEST remediation?
⚠ Common exam trap
SSCP often tests the difference between root-cause fixes and compensating controls — candidates may choose input validation or WAFs, but the BEST remediation is always to eliminate the vulnerability by using parameterized queries.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Rewrite all dynamic queries to use parameterized queries
The BEST remediation is to rewrite all dynamic queries to use parameterized queries, as this eliminates the root cause of SQL injection by ensuring that user input is treated as data, not executable code. Parameterized queries (prepared statements) separate SQL logic from data, preventing attackers from altering the query structure. While other measures like input validation and WAFs add defense in depth, they do not fix the underlying vulnerability.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Restrict database user permissions to only necessary tables
Why it's wrong here
Restricting permissions limits what a successful injection could reach, but the concatenated dynamic queries still pass attacker input as executable SQL, so injection remains possible. Least-privilege database accounts are the right control when containing blast radius after a compromise, not when eliminating the injection vector itself.
- ✗
Implement strict input validation for all user inputs
Why it's wrong here
Input validation filters expected formats but cannot reliably neutralise SQL syntax embedded in concatenated strings, so injection remains possible. Validation suits defence-in-depth alongside safe query construction, not as the remediation for dynamic queries built by concatenation.
- ✗
Deploy a web application firewall (WAF) in front of the application
Why it's wrong here
A WAF filters known attack patterns at the network edge but cannot guarantee coverage of every injection variant reaching concatenated queries. WAFs suit blocking generic external threats and virtual patching, not fixing unsafe query construction in application code.
- ✓
Rewrite all dynamic queries to use parameterized queries
Why this is correct
Parameterised queries bind user input as data, not executable SQL, eliminating the concatenation weakness that permits injection. Rewriting every dynamic query removes the vulnerable construction entirely, satisfying the stem's requirement to remediate the root cause rather than patch individual queries.
Go deeper
Related to this question
About these practice questions
One of 971 original SSCP practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on SSCP
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A security administrator discovers that a web application is vulnerable to SQL injection. Which of the following is the most effective mitigation to implement at the application layer?
medium- A.Implement input validation using a blacklist of SQL keywords.
- B.Encrypt the database connection using TLS.
- ✓ C.Use parameterized queries or prepared statements.
- D.Encode all output sent to the browser.
- E.Deploy a web application firewall (WAF) in front of the server.
Why C: (parameterized queries or prepared statements) is the most effective mitigation at the application layer because it ensures user input is treated as data, not executable SQL code, thus preventing SQL injection. Option A (input validation via blacklist) can be bypassed by attackers using encoding or alternative characters. Option B (encrypting the database connection with TLS) protects data in transit but does not prevent SQL injection. Option D (output encoding) addresses cross-site scripting (XSS), not SQL injection. Option E (deploying a WAF) operates at the network layer and can be circumvented; it is not an application-layer control.
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official ISC2 exam blueprint
This SSCP practice question is part of Courseiva's free ISC2 certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SSCP exam.