Inserting Data
Long ago, when the era of web applications backed by SQL databases started to bloom, there were some gutsy people who invented the SQL injection attack. A type of authentication is done via SQL queries against a database and, for example, after converting the password with mathematical magic into hash functions, all the web app did was execute the query with the username and password coming from the input of the form. Many servers executed something like this:
"SELECT password FROM Auth WHERE username=<input from user>"
Then, the password gets rehashed; if the two hashes match, the password was good for the user.
The problem with this came from the <input from user>
part, because if the attacker was smart enough, they could reformulate the query and run additional commands. For example:
"SELECT password FROM Auth WHERE username=<input from user> OR '1'='1'"
The problem with this query is that OR...