Reputation: 4348
I have a jsp file with the following code snippet:
<form action=<%= request.getContextPath() %>/query_flight? ...
When using codesecue to do static code check, I got an XSS attack warning:
But I am confused because context.getContextPath
is a Java EE standard API. Is it possible to do an XSS attack??
Any suggestion?
Upvotes: 0
Views: 690
Reputation: 691973
The tool is wrong. That said, I would use the <c:url>
JSTL tag to generate the URL. It would take care of the context path, and of URL rewriting if necessary to track sessions.
Upvotes: 2