diff --git a/WebGoat/App_Code/DB/MySqlDbProvider.cs b/WebGoat/App_Code/DB/MySqlDbProvider.cs index 0bc79812..4acf199a 100644 --- a/WebGoat/App_Code/DB/MySqlDbProvider.cs +++ b/WebGoat/App_Code/DB/MySqlDbProvider.cs @@ -200,8 +200,9 @@ public string GetCustomerEmail(string customerNumber) using (MySqlConnection connection = new MySqlConnection(_connectionString)) { - string sql = "select email from CustomerLogin where customerNumber = " + customerNumber; + string sql = "select email from CustomerLogin where customerNumber = @customerNumber"; MySqlCommand command = new MySqlCommand(sql, connection); + command.Parameters.AddWithValue("@customerNumber", customerNumber); output = command.ExecuteScalar().ToString(); } }