Answer the question
In order to leave comments, you need to log in
Spring Boot, Checkmarx and Stored XSS: how to solve HIGH notifications?
There is an application with a bunch of Spring Boot, Spring Data. I analyzed the code with Checkmarx. Received a HIGH warning that the code is susceptible to a Stored XSS attack. I analyzed the recommendation from the site https://www.checkmarx.com/blog/3-ways-prevent-xss/ , as well as stackoverflow and other well-known sources, it turned out that it was necessary to get rid of html tags. I used HtmlUtils.htmlEscape and StringEscapeUtils.escapeHtml4, but I never got rid of the error. The error is related to the fact that a possible request with an xss attack could be saved in the database, and when retrieved, "inconsistent" data will be sent to the UI. This is not exactly my code, but something like this:
Set<User> users = repo.getUsers();
Checkmarx swears at the getUsers method. Tried to prevent this problem by:
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question