These are the intended XSS-vulnerabilities. Some of the solutions will be blocked by your browsers XSS protection.

There might be one more :-)

Visitor fun facts:

Number of countries:44
Top 3 visiting countries:India (18.50%), USA(14.99%), Norway(10.53%)
Average time on page:00:04:45
Top 3 browsers:Chrome (52.3%), Firefox (31.9%), Safari (4.94%)
Top 3 OS:Windows(61.56%), OS X (13.72%), Linux (12.76%)
Java enabled72,57%
Vulnerable flash version:At least 10%

1. Flash based XSS

This is a classic XSS error found in loads of flash ads. They have a parameter called clickTAG allowing the embdding party to at a later time specify the link to which the ad should forward to upon click.
<object width="500" height="100">
<param name="movie" value="xssmas.swf?clickTAG=gifts.html">
<embed src="xssmas.swf?clickTAG=gifts.html" 
width="500" height="100">
However because a flash can be referenced directly, we can do something like this:

2. DOM-based XSS

This combined reflected and DOM-based XSS relies upon the javascript receiving a variable n with a value from a URL-parameter. The value is partially escaped, and then copied url decoded and written using jQuery's html().

var n = '';
if (n != '') {
	$(function() {
		$("h1").html("Merry XSSmas, " + unescape(n) + "!");

By double URL encoding the data, it's easy to bypass the partial escaping.

There might be another vulernability here as well, as the partial escaping is escaping these characters: ' <> / As we see it's not escaping the backslash, so a value of \' will render as \\', and thus breaks out of the string. Has anybody found a solution for this one?

3. and 4. Reflected XSS and DOM-based XSS

In the fake script below it's pretending to do analytics, but there are two big mistakes here. The escaping in use is for HTML only, when this is clearly a javascript + HTML context.

<!-- Analytics: no change below this line -->
document.write('<img src="analytics?url=query string">');

So the the first vulnerability is lack of javascript escaping. By entering a single quote we break out of the string. We can then run arbitrary javascript'%2Balert(1)%2B'

The second problem here is that the escaping is by mistake using a replace instead of replaceAll. So even though <, > and " is escaped, we can easily bypass it to make the javascript write malicious javascript code*

5. Wrong Content-Type

The search field loads a JSON feed of search results, which also includes the query as a part of the response. By opening the search result JSON directly in the browser, the browser will interpret the content as HTML instead of JSON. We can thus simply put in a single script tag and have it execute


Some people sent me solutions using the URL This is simply a different way to reference the same index.php as the one at The reason why the page looks different is, the references to the JS and stylesheet does not work when referenced this way.