Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Re: Re: Re: Preventing Cross-site Scripting Attacks

by Dog and Pony (Priest)
on Feb 24, 2002 at 19:14 UTC ( [id://147192]=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Re: Preventing Cross-site Scripting Attacks
in thread Preventing Cross-site Scripting Attacks

I think tye has a good warning at his home node, where he says that someone can steal your password if you have javascript enabled.

In short, the problem is this: Javascript can access the cookies you have for the current site. Without going into too much detail, it only take a few lines of javascript to grab your login cookie and send it to a script at some site, and it only takes a few lines of for example perl to craft a cookie for a browser that will allow anyone to log in as you. Notice that with this method, you don't even need to decode the password!

I haven't tried it at this site, nor will I, so I am not 100% that there aren't any safeguards against it that I am unaware of. But I have, as an experiment, crafted just such a thing on above mentioned I was able to steal my own password and log in with a crafted cookie at a computer that I never had went there with before. I am a curious soul.

It is quite possible that one shouldn't be talking about this, so as to not give anyone any ideas. But I do this anyways, for two purposes. If you are aware of how easy this would be to accomplish, you will hopefully protect yourself. And maybe scripts and event handlers will be stripped out from user-provided HTML. As a sidenote, I wonder if our moves are tracked via IP or something at this site, so it would be sufficiently easy to prove you didn't do a certain thing, and also to track the thief if needs would be?

Again, note that this is only a risk where you have both these things; session-cookies which identify you, and the possibility for users to add arbitrary javascript to a page you will be viewing.

Does that explain the matter?

You have moved into a dark place.
It is pitch black. You are likely to be eaten by a grue.
  • Comment on Re: Re: Re: Re: Preventing Cross-site Scripting Attacks

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Preventing Cross-site Scripting Attacks
by markmoon (Deacon) on Feb 26, 2002 at 03:38 UTC
    Yes it does. Thanks a lot for the explanation.


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://147192]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-23 01:04 GMT
Find Nodes?
    Voting Booth?

    No recent polls found