Question: In reviewing a source code of an ASP.Net web application, you have discovered the following routine for a login page: protected void Authenticate (object

In reviewing a source code of an ASP.Net web application, you have 

In reviewing a source code of an ASP.Net web application, you have discovered the following routine for a login page: protected void Authenticate (object theSender, AuthenticateEventArgs theEvent) { SqlConnection conn = new SqlConnection(@"Data Source-. \sqlexpress; Initial Catalog MyDb;Integrated Security=True"); string query="SELECT * FROM UsersTable WHERE Email = "" + Login.UserName + "" AND Password =HASHBYTES ('SHA2_512', " + Login.Password + "'+ salt)"; adapter = new SqlDataAdapter(query, conn); dataTable new DataTable(); adapter.Fill(dataTable); if (dataTable.Rows.Count >= 1) { } Response.Redirect("index.aspx"); Identify the vulnerability and remediate the code using appropriate countermeasures. Demonstrate how the vulnerability is formed from the user input.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The code provided contains a significant security vulnerability known as SQL injection The vulnerabi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!