somebody wrote:
Quote:
I've been informed of a cross-site scripting vulnerability.
Given the example of this exploit below, how to you prevent
this from being passed to the perl cgi script myscript.cgi?
|
You can't keep it from passed to your server; someone could simply
type the attack into the browser address bar, for example. This is not
a Javascript issue, it's a server issue...
What you have to do is filter / verify any input that you will echo
back. Generally, filtering out <>#() and quotes will stop most
attacks. However, see the following url for a hacker's view of ways
around many filter traps:
http://ha.ckers.org/xss.html
Note that an XSS attack won't work if you don't blindly echo back an
input !! In other words, if your URL looks like, say:
http://math.com/add_two_numbers.asp?x=1&y=2
and adds x + y together and returns just the result without echoing x
or y, then no attack is possible.
Kev