Cloud Application Security
A code review finds a cloud web app builds database queries by concatenating user-supplied form values into SQL strings. Which fix BEST removes the underlying vulnerability?
Show the answer
Correct answerC. Use parameterized queries
AWhy not this: Hashing input would break the values and does not stop injected SQL from being interpreted.
BWhy not this: A WAF can block known patterns but is a compensating control; the flawed query remains.
CWhy this is right: Parameters separate code from data, so input cannot alter the SQL statement structure.
DWhy not this: Encryption at rest protects stored data from media theft, not injection through the application.
Parameterized queries keep user input as data, never as executable SQL, which removes the injection flaw in the code. A WAF rule only filters some attacks at the perimeter and leaves the vulnerable code in place.