title: How to Solve Trust Boundary Violation in session.setAttribute() point out by SONAR?
body: <p>I am getting this error as SONAR violation in these line . How to solve this?                          </p>
  
  <pre><code>HttpSession session = this.globals.getHTTPServletRequest()
                                     .getSession();                       
  session.setAttribute("CONTEXT",this.globals.getHTTPServletRequest().getContextPath());
  //issue is in this line 
  </code></pre>
  
  <p>Make sure the user is authenticated before this data is stored in the session.</p>
  
  <p>This is SONAR output for that line</p>
  
  <p>{</p>
  
  <p>Rule</p>
  
  <p>Changelog
  Untrusted data should not be stored in sessions
  Data in a web session is considered inside the "trust boundary". That is, it is assumed to be trustworthy. But storing unvetted data from an unauthenticated user violates the trust boundary, and may lead that that data being used inappropriately.
  This rule raises an issue when data from Cookies or HttpServletRequests is stored in a session.
  Noncompliant Code Example</p>
  
  <pre><code>login = request.getParameter("login");
  session.setAttribute("login", login);  // Noncompliant
  </code></pre>
  
  <p>See
  MITRE, CWE-501 - Trust Boundary Violation}</p>