Questions tagged [antisamy]

An API for ensuring user-supplied HTML/CSS is in compliance within an application's rules.

Antisamy is an API for ensuring user-supplied HTML/CSS is in compliance within an application's rules. Another way of saying that could be: It's an API that helps you make sure that clients don't supply malicious cargo code in the HTML they supply for their profile, comments, etc., that get persisted on the server. The term "malicious code" in regards to web applications usually mean "JavaScript." Cascading Stylesheets are only considered malicious when they invoke the JavaScript engine. However, there are many situations where "normal" HTML and CSS can be used in a malicious manner. So we take care of that too.

Philosophically, AntiSamy is a departure from contemporary security mechanisms. Generally, the security mechanism and user have a communication that is virtually one way, for good reason. Letting the potential attacker know details about the validation is considered unwise as it allows the attacker to "learn" and "recon" the mechanism for weaknesses. These types of information leaks can also hurt in ways you don't expect. A login mechanism that tells the user, "Username invalid" leaks the fact that a user by that name does not exist. A user could use a dictionary or phone book or both to remotely come up with a list of valid usernames. Using this information, an attacker could launch a brute force attack or massive account lock denial-of-service. We get that.

Unfortunately, that's just not very usable in this situation. Typical Internet users are largely pretty bad when it comes to writing HTML/CSS, so where do they get their HTML from? Usually they copy it from somewhere out on the web. Simply rejecting their input without any clue as to why is jolting and annoying. Annoyed users go somewhere else to do their social networking.

53 questions
0
votes
1 answer

Why is getSafeHTML() throwing an error?

I seem to be getting an error that the content is too long, but I never specified that there was a limit of 5000. 5000 is way too low anyway Error validating html input. Invalid HTML input. Error=The input was too large. The specified input was…
James A Mohler
  • 11,060
  • 15
  • 46
  • 72
0
votes
1 answer

Getting antisamy-esapi.xml not found exception while trying to use OWASP ESAPI library

I am trying to use getValidSafeHtml () function of esapi library but getting the following exception org.owasp.esapi.errors.ConfigurationException : Couldn't find antisamy-esapi.xml I have copied antisamy-esapi.xml in the same directory where I…
androidDev
  • 1,179
  • 4
  • 13
  • 31
0
votes
1 answer

Antisamy Java regex url does not accept pound or hash sign

In the antisamy xml config, this is what I have set: That seems to work except for links with the pound/hash…
Greg H
  • 23
  • 9
0
votes
0 answers

Performance issue using AntiSamy filter in Spring MVC

In my Web application project we are using AntiSamy filter to validate the user input, after including it the performance of the application is too slow to load a screen.. I believe it is because of using Antisamy. Please let me know if there any…
user3751955
  • 45
  • 1
  • 5
0
votes
1 answer

XSS Security using AntiSamy in Spring MVC

I want to filter the contents of all input tags from my HTML. I am using the AntiSamy filter, as of now my filter is filtering out complete html content (instead of input value only). I am using the implementation provided here: Github Inside the…
nexus
  • 172
  • 2
  • 15
0
votes
1 answer

XSS sanitizing nested html tags input

I'm using antisamy library to sanitize input to my application against XSS. I have problem with nested tags like a: <script>alert('xss');</script> My sanitize method looks like: public String clean(String input) { if (input == null)…
0
votes
1 answer

Antisamy 1.5.3 span tag style attribute exception

I am using antisamy 1.5.3 along with following dependencies batik-1.5-fop-0.20-5.jar nekohtml-1.9.6.jar xercesImpl-2.9.1.jar Hi I have an input html string str = "

0
votes
3 answers

Does Antisamy prevents Sql Injection

I was trying to write my own filter before I came across antisamy project that allows you to configure and prevent XSS attack. But I was just wondering if same can be used to prevent sql injection attack? Any one who has implemented antisamy to…
astra03
  • 505
  • 1
  • 7
  • 18
1 2 3
4