Ajay AJ (Community Member) asked a question.

How to fix CWE 201. Not getting proper solution

var values = new System.Collections.Specialized.NameValueCollection()

        {

          { "Grant_Type", "password" },

          { "Username", KEY },

          { "Password", PASSWORD }

        };

 

Getting CWE 201 error in the code. Where the key and password were stored in database.


  • Veracode Static Analysis reports flaws of CWE-201: Insertion of Sensitive Information Into Sent Data when it can detect that sensitive data (such as from configuration) is going into outgoing network traffic (for example an email or HTTP request).

    The risk is that if sensitive data is incorrectly used this may lead to leakage of information.

    Storing data in the database should not result in a CWE 201 flaw, this may mean Veracode Static Analysis is unable to see that this data is going to a database (rather than, say, to an HTTP Response).

    I would recommend you schedule a consultation call to discuss.

    You can check out this knowledge article (https://community.veracode.com/s/article/How-to-schedule-a-consultation-call) on how to schedule a consultation call with us.

     

    Thank you,

    Boy Baukema

     

    Expand Post
    • Ajay AJ (Community Member)

      var values = new System.Collections.Specialized.NameValueCollection()

              {

                { "Grant_Type", "password" },

                { "Username", HttpUtility.HtmlEncode(KEY) },

                { "Password", HttpUtility.HtmlEncode(PASSWORD) }

              };

       

      Will this fix works? HttpUtility.HtmlEncode each data sent out.

      Expand Post
      • No, HTMLEncoding is not supported (or recommended) for CWE 201 as the issue is not lack of encoding but sensitive information being sent out.

Topics (4)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.