All,
Is the following susceptible to XSS attacks?
Assuming that ${userInput} comes directly from the user or from the query string.Code:<spring:message code="some.message.with.args" arguments="${userInput}"/>
For example, if my URL is as follows: www.mysite.com/q=<script>alert('xss')</script>
and I do this in my JSP :
Is this a XSS vulnerability (i.e., will the script tags be interpreted by the browser)? I believe the answer to be yes.Code:<spring:message code="some.message.with.args" arguments="${param.q}"/>
Furthermore, I am under the impression that to protect against this, one would do the following:
Does this sound correct?Code:<spring:message code="some.message.with.args" arguments="${fn:escapeXml(param.q)}"/>


Reply With Quote