Fast question, can you break it?
URL: http://eaea.sirdarckcat.net/testhtml.html
The objective is simple:
Quote
Find a valid HTML code that will be parsed incorrectly by the parser, AND/OR code that executes (if I forgot to remove some vector).
I will be removing basic JS execution vectors, anyway the CSS parser is not ready yet so I'll disable CSS completely. Also namespaces wont be allowed (no xul nor svg) and ns tags (<asdf:asdf>) will also be disabled for the time being.
frames wont be allowed (as well as embed/object/video/audio/etc..) and I think that's all :).
If you can execute JS let me know please :).
On IE I try to honor conditional comments, anyway I wont support them completely, since they are
unsafe by
default.
If you find some way to get HTML code where it shouldnt in weird scenarios you win!
I have to warn you that code like this:
<a href="asdf'><img src="http://www.google.com">hello</a>
Will be parsed as:
<a>hello</a>
Since every time I find " in an attribute's name, I will delete all arguments in the tag for security reasons.
So this other code (it's important to note there's no closing " quote):
<a href="asdf'><img src='http://www.google.com'>hello</a>
Will be parsed as:
<a><img src="http://www.google.com">hello</a>
Some may argue that's a vulnerability, but there's no safer way of treating unclosed quotes in attributes.
Other thing: I am only allowing ' and " as quotes (so, ` wont work).
So well, examples of bypasses I've found (and are now fixed):
<!--[if true]><img onerror=alert(1) src=-->
<form action=javascript:alert(1)><input type=submit>
Protections vary from browser to browser (I will only remove dangerous things on a browser if they are dangerous in that browser).
I will make the CSS parser this week :)
Greetings!!
--------------------------------
http://sirdarckcat.blogspot.com/ http://www.sirdarckcat.net/ http://foro.elhacker.net/ http://twitter.com/sirdarckcat