Query Trail
SQL parameterization
SQL PARAMETERIZATION
Building SQL by concatenating untrusted strings changes the query structure. Parameterized statements keep values separate from SQL syntax.
LEARNING GOAL
Identify the failure from the supplied synthetic evidence and explain a defensive fix.
EVIDENCE
UNSAFE: sql = "SELECT * FROM items WHERE sku='" + sku + "'" SAFE: sql = "SELECT * FROM items WHERE sku=?"; db.execute(sql,[sku]) review_marker=parameters_not_patches
HINT
The safe version binds the sku as a value.
KNOWLEDGE CHECK
Which query construction should replace concatenation?
The safe version binds the sku as a value.
Submit the review marker in SG{marker} format.
Progress stays in this browser.
DEFENSIVE TAKEAWAY
Use prepared statements and allowlists where identifiers cannot be parameterized.