Exemplo n.º 1
0
        /* goodG2B() - use goodsource and badsink */
        private void GoodG2B()
        {
            string data;

            /* FIX: Use a regular string (non-sensitive string) */
            data = "Hello World";
            CWE319_Cleartext_Tx_Sensitive_Info__send_51b.GoodG2BSink(data);
        }
Exemplo n.º 2
0
        /* goodB2G() - use badsource and goodsink */
        private void GoodB2G()
        {
            string data;

            using (SecureString securePwd = new SecureString())
            {
                for (int i = 0; i < "AP@ssw0rd".Length; i++)
                {
                    /* INCIDENTAL: CWE-798 Use of Hard-coded Credentials */
                    securePwd.AppendChar("AP@ssw0rd"[i]);
                }

                /* POTENTIAL FLAW: Set data to be a password, which can be transmitted over a non-secure
                 * channel in the sink */
                data = securePwd.ToString();
            }
            CWE319_Cleartext_Tx_Sensitive_Info__send_51b.GoodB2GSink(data);
        }