$ ./guess_the_languageCybersecurity
Cybersecurity · medium · #158

Which change removes the vulnerability?

query = "SELECT * FROM users WHERE id = '" + userId + "'"
  1. Use a parameterised query
  2. Escape the HTML output
  3. Add an index on the id
  4. Rename the users table
Binding the value as a parameter keeps it data, so it can never become SQL.
Play Cybersecurity ▸