Courseiva
Software Development SecuritymediumMultiple ChoiceObjective-mapped

CISSP Software Development Security Practice Question

A development team is implementing a web application that allows users to search for products. To prevent SQL injection attacks, which secure coding practice should be applied?

⚠ Common exam trap

Many candidates confuse stored procedures as a silver bullet for SQL injection, failing to realize that the security lies in how parameters are bound, not in the procedure container itself.

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

Parameterized queries with prepared statements

Parameterized queries with prepared statements (Option B) are the definitive defense against SQL injection because they separate SQL logic from user-supplied data. The database engine compiles the query structure first, then binds input values as parameters, ensuring that malicious input cannot alter the intended SQL command. This approach is language-agnostic and works across all modern database interfaces (e.g., JDBC, PDO, ADO.NET).

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Input validation using a blacklist of SQL keywords

    Why it's wrong here

    Input validation using a blacklist of SQL keywords is an inherently weak and unreliable defense against SQL injection. Attackers can easily bypass such filters through various obfuscation techniques, including character encoding, comment injection, or alternative SQL syntax. This approach relies on anticipating every possible malicious input, which is practically impossible, making it an ineffective security measure.

  • Parameterized queries with prepared statements

    Why this is correct

    Parameterized queries with prepared statements are the most effective defense against SQL injection vulnerabilities. By separating the SQL code from user-supplied data, the database engine can distinguish between the query structure and the values to be inserted, updated, or retrieved. This mechanism ensures that user input is always treated as literal data, preventing it from being interpreted as executable SQL commands.

  • Output encoding of user input

    Why it's wrong here

    Output encoding of user input is a crucial security measure, but it specifically targets Cross-Site Scripting (XSS) vulnerabilities, not SQL injection. Its purpose is to neutralize malicious scripts or tags before data is rendered in a web browser, preventing client-side code execution. This process occurs at the point of display, long after the data has been processed by the database, making it ineffective against attacks that target the database itself.

  • Using stored procedures exclusively

    Why it's wrong here

    While stored procedures can offer some protection by encapsulating database logic, relying on them exclusively does not inherently prevent SQL injection. If dynamic SQL is constructed within a stored procedure by concatenating user input, the same vulnerability exists as with direct application queries. True security comes from using parameterized queries *within* stored procedures, ensuring that all user-supplied values are treated as data, not executable code.

About these practice questions

One of 747 original CISSP 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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CISSP 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 CISSP exam.