simple error due to use of double quotes in a jsp file

前端 未结 7 1697
清酒与你
清酒与你 2020-12-14 00:36

I have the following line of code in a JSP File in my web app that is giving an error:



        
7条回答
  •  情书的邮戳
    2020-12-14 01:02

    The example looks like a XSS example! This is a security vulnerability. I suggest to put in place a html encoding library like c:out tag or http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/Encoder.html#encodeForHTMLAttribute%28java.lang.String%29

    I also suggest to take the userName from an authenticated session and not form the request param if possible (unless this is a login/registration form only!)

提交回复
热议问题