SQL injection is a technique where malicious users can inject SQL commands into an SQL statement, via web page input. Injected SQL commands can alter SQL statement and compromise the security of a web application. SELECT * FROM Users WHERE UserId = 105 or 1=1 Look at the example above. The SQL above is valid. It will return all rows from the table Users, since WHERE 1=1 is always true. Does the example above seem dangerous? What if the Users table contains names and passwords? The SQL statement above is much the same as this: SELECT UserId, Name, Password FROM Users WHERE UserId = 105 or 1=1 A smart hacker might get access to user names and passwords in a database by simply inserting " or ""=" into the user name or password text box. The code at the server will create a valid SQL statement like this: SELECT * FROM Users WHERE Name ="" or ""="" AND Pass ="" or ""=...
Don’t walk in front of me… I may not follow Don’t walk behind me… I may not lead Walk beside me… just be my friend