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