[url=http://domainname/context/somepath/somepage.htm?printable=true"+onmouseover="window.location=%27//www.netspi.com/';"+" ]Xss inserted URL[/url]
Encoding is an option but I dont even want to handle such requests. Is there any way of doing that? I browsed OWASP and other security sites but everybody is explaining encoding user input. I want to throw such requests to error page and log them in server logs.
I think you should validate the inputs and process only trusted data. In this case you know "printable" query parameter should take only "true" or "false" .If you find anything other than these possible values just return some default value or generate a user defined DataValidationException to you can map a global error page.
Joined: Apr 06, 2006
Thanks Manjesh for your reply.
I have used ESAPI decode to decode the URL. In my case it would be unable to decode it properly and give error which is what I wanted.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com