It's a slf4j logger and i have been trying to log error with 2 messages parameters.
catch(ExecutionException executionException) {
LOGGER.error("TimeoutException caught , Error: " + SSG_TIMEOUT.getErrorText()
+ ". Message: " +executionException.getMessage());
}
SSG_TIMEOUT.getErrorText()
results to a String "TimeOut error encountered"
Things i used
Manual sanitize code
return entry.replace("\t", "\\t").replace("\b", "\\b").replace("\n", "\\n").replace("\r", "\\r").replace("\f", "\\f").replace("\u0000", "\\0").replace("\\a", "\\a").replace("\\v", "\\v").replace("\\e", "\\e").replaceAll("\\p{Cntrl}", "").replace("'", "\\'").replace("\"", "\\\"").replace("\\", "\\\\");
StringEscapeUtils.escapeJson(String errorMessage)
String builder to append string +
escapeJson(StringBuilder.toString())
Still i see the issue in my veracode report.
Any Suggestions?