使用SQL注入进行身份验证绕过

时间:2013-07-18 07:14:25

标签: asp.net .net

进行安全扫描时,此错误显示为高:

Remediation Tasks: Filter out hazardous characters from user input ?
for parameter (Parameter = txtPassword),(Parameter = btnLogin) and (Parameter = txtName)

所有这些都在这里的代码中使用:

With sqlcomm.Parameters
   .AddWithValue("@userName", DataEncryption.DataEncryption.EncryptString(LCase(txtName.Text), "OmSs23re24&&UsErNa(Me"))
   .AddWithValue("@Pass", DataEncryption.DataEncryption.EncryptString(txtPassword.Text, "OmSP12aSsW%%8oR*d"))
End With

If (Session("Admin") Is Nothing) Then
    If txtName.Text = txtPassword.Text Or forgotpassCls.GetUserLoginFlag(Session("custid").ToString()) Then
       If ForceChange = "True" Then
            Response.Redirect("ChangePassword.aspx", True)
       Else
            Response.Redirect(DefaultURL, True)
       End If
    End If
 Else '' if the user is an admin
     If txtName.Text = txtPassword.Text Or forgotpassCls.GetUserLoginFlag(Session("Admin").ToString()) Then
         If ForceChange = "True" Then
              Response.Redirect("ChangePassword.aspx", True)
          Else
               Response.Redirect(DefaultURL, True)
          End If
      End If
 End If

我该怎么办?

0 个答案:

没有答案