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"); CWE427_Uncontrolled_Search_Path_Element__Params_Get_Web_51b.BadSink(data, req, resp); }
/* goodG2B() - use goodsource and badsink */ private void GoodG2B(HttpRequest req, HttpResponse resp) { string data; /* FIX: Set the path as the "system" path */ if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { data = "/bin"; } else { data = "%SystemRoot%\\system32"; } CWE427_Uncontrolled_Search_Path_Element__Params_Get_Web_51b.GoodG2BSink(data, req, resp); }