Skip to content

Commit

Permalink
✨ (CodeQL) SQL query built from user-controlled sources
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeebot[bot] authored May 13, 2024
1 parent 1c6cab1 commit 21dd513
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion WebGoat/App_Code/DB/MySqlDbProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit 21dd513

Please sign in to comment.