2021年1月6日星期三

How to sanitize and validate user input to pass a Checkmarx scan in asp.net c#

In Checkmarx scan I am receiving the vulnerable EXCEPTION,

gets user input for the dr element. This element's value then flows through the code without being properly sanitized or validated and is eventually displayed to the user in method

 List<survey_bene> surveybenelist = new List<survey_bene>();   cmd = new SqlCommand("SELECT ResondantCode FROM Respondant");   DataTable dtdetails = vdm.SelectQuery(cmd).Tables[0];   if (dtdetails.Rows.Count > 0)   {       foreach (DataRow dr in dtdetails.Rows)        {           survey_bene survey = new survey_bene();           survey.resondantcode = dr["ResondantCode"].ToString();           surveybenelist.Add(survey);        }   }  
https://stackoverflow.com/questions/65595562/how-to-sanitize-and-validate-user-input-to-pass-a-checkmarx-scan-in-asp-net-c-sh January 06, 2021 at 08:13PM

没有评论:

发表评论