/* goodG2B() - use goodsource and badsink */ private static void GoodG2B(HttpRequest req, HttpResponse resp) { string data; /* FIX: Use a hardcoded class name */ data = "Testing.test"; string[] dataArray = new string[5]; dataArray[2] = data; CWE470_Unsafe_Reflection__Web_Params_Get_Web_66b.GoodG2BSink(dataArray, req, resp); }
public override void Bad(HttpRequest req, HttpResponse resp) { string data; /* POTENTIAL FLAW: Read data from a querystring using Params.Get */ data = req.Params.Get("name"); string[] dataArray = new string[5]; dataArray[2] = data; CWE470_Unsafe_Reflection__Web_Params_Get_Web_66b.BadSink(dataArray, req, resp); }