Courseiva
easyMultiple Choice

CISSP Practice Question: During a code review, a developer identifies a…

During a code review, a developer identifies a SQL injection vulnerability. What is the most effective fix?

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

✓

Implement parameterized queries.

Parameterized queries (prepared statements) ensure user input is treated as data, not executable code. Stored procedures can still be vulnerable if dynamically built. Escaping input is error-prone. ORMs often use SQL underneath and may not prevent injection if misused.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Use stored procedures exclusively.

    Why it's wrong here

    Stored procedures can still build dynamic SQL through string concatenation, so they do not eliminate injection; parameterised queries do. It is tempting because stored procedures restrict direct table access and were long recommended, and would be correct when they accept no concatenated input.

  • ✗

    Use an ORM framework.

    Why it's wrong here

    ORM frameworks can still emit raw or concatenated SQL through query builders, so injection remains possible unless parameterisation is used. They are tempting because they reduce boilerplate and map objects to tables, and would be the right choice for accelerating data-access code, not for eliminating injection at the query boundary.

  • ✗

    Escape all input.

    Why it's wrong here

    Escaping input is context-dependent and error-prone; a missed metacharacter or wrong encoding still permits injection, whereas parameterised queries send data separately from SQL. Escaping is tempting because it is a familiar defence-in-depth measure, and would be correct for safely rendering untrusted data into HTML or shell contexts.

  • ✓

    Implement parameterized queries.

    Why this is correct

    Parameterised queries separate SQL code from user-supplied data, so input is treated as a value rather than executable syntax. This eliminates the injection vector at its source, unlike input sanitisation or escaping, which are bypassable and error-prone.

About these practice questions

One of 816 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.