String Concatenation in SQL Queries
The query is built with formatted strings that include user input, rather than using parameters, allowing input to change SQL syntax.
Preview example – CSHARP
// VULNERABLE: String concatenation
string query = "SELECT * FROM users WHERE id = " + userId;
SqlCommand cmd = new SqlCommand(query, connection);
SqlDataReader reader = cmd.ExecuteReader();