CHung154202 (Community Member) asked a question.

How to fix : Fill() constructs a dynamic SQL query using a variable derived from untrusted input.

Hi, here are my snippet code, simplified for explanation

 

this.Command = new SqlCommand(<storedProcedureName>, this.Connection);

this.Command.CommandType = CommandType.StoredProcedure;

SqlParameter parameter = new SqlParameter(name, <value>);

parameter.Direction = direction;

this.Command.Parameters.Add(parameter);

this.Command.Prepare();

da = new SqlDataAdapter(this.Command);

ds = new DataSet();

da.Fill(ds);

 

Then I got this :

Fill() was called on the da object, which contains tainted data. 

 

How to solve this ?

I don't get the main point of veracode saying tainted data


Topics (1)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.