Basically I have a web-app which it currently is vulnerable to XSS. Based on my research I found one of good and open library that can help would be AntiSamy. So I downloaded the library .jar file which is antisamy-1.5.1.jar
and The policy file antisamy-slashdot-1.4.4.xml
and exported it to my project WEB-INF directory.
I'm pretty much new to AntiSamy and don't really know how to implement it on a string to encode and secure it from XSS.
Say I've a string of: String XSSPossible = "<script>alert("It's vulnerable.");</script>";
Now I want to encode this to a normal text and secure it from XSS.
Much Regards.