Exemplo n.º 1
0
        public override void Bad()
        {
            string data;

            /* FLAW: Set data to a hardcoded string */
            data = "7e5tc4s3";
            CWE259_Hard_Coded_Password__NetworkCredential_51b.BadSink(data);
        }
Exemplo n.º 2
0
        /* goodG2B() - use goodsource and badsink */
        private void GoodG2B()
        {
            string data;

            data = ""; /* init data */
            /* FIX: Read data from the console using ReadLine() */
            try
            {
                /* POTENTIAL FLAW: Read data from the console using ReadLine */
                data = Console.ReadLine();
            }
            catch (IOException exceptIO)
            {
                IO.Logger.Log(NLog.LogLevel.Warn, "Error with stream reading", exceptIO);
            }
            CWE259_Hard_Coded_Password__NetworkCredential_51b.GoodG2BSink(data);
        }