Exemplo n.º 1
0
        /* goodG2B() - use goodsource and badsink */
        private static 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__Get_Cookies_Web_71b.GoodG2BSink((Object)data, req, resp);
        }
Exemplo n.º 2
0
        public override void Bad(HttpRequest req, HttpResponse resp)
        {
            string data;

            data = ""; /* initialize data in case there are no cookies */
            /* Read data from cookies */
            {
                HttpCookieCollection cookieSources = req.Cookies;
                if (cookieSources != null)
                {
                    /* POTENTIAL FLAW: Read data from the first cookie value */
                    data = cookieSources[0].Value;
                }
            }
            CWE427_Uncontrolled_Search_Path_Element__Get_Cookies_Web_71b.BadSink((Object)data, req, resp);
        }