Almost rightLesson 041 min
This login query can be rewritten by the user
A login that builds its SQL query by gluing in the user's text can be rewritten by that user. A password containing a quote mark closes the text early, and the rest becomes part of the query: the password matches, or one equals one. Since one always equals one, the login passes. This is SQL injection. The fix is a parameterised query, where values travel separately as data.
Remember
Never build a query by joining strings; pass values as parameters.
