title: MALICIOUS_CODE EI_EXPOSE_REP Medium
body: <p>I run findbugs against all of my code and only tackle the top stuff. I finally got the top stuff resolved and now am looking at the details. I have a simple entity, say a user:</p>
  
  <pre><code>public class User implements Serializable
  {
      protected Date birthDate;
  
      public Date getBirthDate()
      {return(birthDate);}
  
      public void setBirthDate(final Date birthDate)
      {this.birthDate = birthDate;}
  }
  </code></pre>
  
  <p>This class is incomplete, so don't harp me about it missing the <code>serialVersionUID</code> and other standard stuff, I am just concerned with the <code>birthDate</code> security hole.</p>
  
  <p>Now, according to the findbugs report, since I am returning a reference to a mutable object, that is a potential security risk. In practice though, how much does that really matter?</p>
  
  <p><a href="http://findbugs.sourceforge.net/bugDescriptions.html#EI_EXPOSE_REP" rel="noreferrer">http://findbugs.sourceforge.net/bugDescriptions.html#EI_EXPOSE_REP</a></p>
  
  <p>I suppose I still don't really see what the problem is here in this case.  Should I pass in a <code>long</code> and set the date from that?</p>
  
  <p>Walter</p>