0

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 ?

Pavan Divekar
  • 449
  • 2
  • 14

1 Answers1

0

Use ESAPI(The OWASP Enterprise Security API) . Its totally free.

After setup ESAPI below code will resolve the issue.

ESAPI.encoder().decodeForHTML(username)

Mayur Jain
  • 149
  • 5