Access Control: Database Fortify

Viewed 30816

We ran the Fortify scan and had some Access Control: Database issues. The code is getting the textbox value and setting it to a string variable. In this case, it's passing the value from the TextBox to the stored procedure in a database. Any ideas on how I can get around this Access Control: Database issue?

Without proper access control, the method ExecuteNonQuery() in DataBase.cs can execute a SQL statement on line 320 that contains an attacker-controlled primary key, thereby allowing the attacker to access unauthorized records.

Source: Tool.ascx.cs:591 System.Web.UI.WebControls.TextBox.get_Text()

rptItem.FindControl("lblClmInvalidEntry").Visible = false;    
ToolDataAccess.UpdateToolData(strSDN, strSSNum, strRANC, strAdvRecDate, strAdvSubDate,  strClmRecDate, strClmAuth, strClmSubDate, strAdvAuth, txtNoteEntry.Text);

Sink: DataBase.cs:278


System.Data.SqlClient.SqlParameterCollection.Add()
// Add parameters
foreach (SqlParameter parameter in parameters)
cmd.Parameters.Add(parameter);

1 Answers
Related