Dedicated to my thoughts while learning cybersec
11/22/2020
What Year is this?

SQL injection is a code injection technique, used to attack data-driven applications, in which malicious SQL statements are inserted into an entry field for execution. By todays standards and with the many readily available options for communicating with a database it is simply astounding why application are still falling prey to the most basic of SQL Injection attacks. The simplest way to avoid SQL Injection attacks is to NEVER TRUST USER INPUT.
String Concatenation is the enemy never should developers allow any form of code or request like the statement below
function FindById(id){
// 😱🤢🤮
let query = "SELECT * FROM users WHERE id = " + id
db.execute(query)
}
Allowing a query to be executed as above allows a user to provide an id which the SQL Injection Attacker could submit an id of 0; DROP DATABASE; or any other number of attacks… Developers, testers, security professionals should all know the user is the real enemy and nothing sent by the user should ever be trusted blindly. All queries must be sanitized properly an never blindly executed.
There are number of methods for reducing the risk of a data breach due to SQL injection. As a best practice, several of the strategies below can and should be used in conjunction with one another.
* character means any and the words OR is a conditional.