I have scan my application in HP fortify portal and getting an issue Cross-Site Scripting: Poor Validation (Input Validation and Representation, Data Flow).
I am already using ESAPI library.
What should I do to solve this issue. Is there any other library/jar to validate the inputs.
Thanks in advance.
Fortify "Cross-Site Scripting: Poor Validation" is complaining that your OUTPUT encoding is either improper or not effective. The purpose of the output encoding (escaping) is to confine the special characters (meta char) as literal string, so they cannot be executed as a command.
To remediate, you do:
Step#1. Determine who is going to consume this "to be encoded context"?
Step#2. Properly Encode the context based on the delivery protocol and the down stream needs. For example:
Step#3. Collect encoding examples for future pick and use:(sorry, when post as code, some contents changed, so post as image)
need to consider overhead of ESAPI library, is it worth to load 30 MB jar for one fix?
Output encoding using light weight org.owasp.encoder library