Every web application that stores data eventually runs a database query shaped by what the user typed. A login form asks for a username and a password; the app builds a SQL query from those values and asks the database whether they match a record.
That sounds harmless — until you realise the user controls part of the query text. If the app simply pastes the input into the SQL string, a clever user can close the string early and append their own SQL. The database has no idea the extra code was not written by the programmer; it obeys it faithfully.
SQL injection is the name for that trick. It has been ranked the number-one web vulnerability for over a decade, responsible for breaches at companies large and small. The root cause is not a complicated flaw — it is the failure to keep data separate from code.
Comments
Loading comments...