I scanned the project with veracode and it is giving issues for CWE ID 93(CRLF injection), This issue is occurring at the bellow line-
InternetAddress[] address = {new InternetAddress(username)};
msg.setRecipients(Message.RecipientType.TO, address);
Veracode is flagging the issue 93 at second line from above code. username is parsed from request object which is string buffer
so one of my colleague suggested me that I should use validate method to remove CRLF characters. Will the validate method on address object remove CRLF delimiters ?