Cross Site Scripting

S

Shabam

I have an application that allows users to input certain html tags via a
markup code (like "
image.gif
"). The
application then translates that into real html for output. I've also had
the application translate "<" to "&lt;" and ">" to "&gt;" to prevent direct
html input by the user.

By doing this I basically allow users to input certain html tags, while not
giving them full permission to mess with the site.

However, I was made aware of cross-site scripting flaws which allow a user
to input something like "javascript:alert(document.cookie)".
This would be translated into "<img
src="javascript:alert(document.cookie)">", which obviously is not good.

My question is, besides this javascript string, what others are there to
filter for, to prevent this type of attack?
 
S

Shabam

Try..
(like "
65MegaBytePicForPaedophiles.jpg
")

What's this got to do with my question? Mine is one of technical filtering,
not content filtering.
The possiblities for abuse of such a system (from any
number of script or non-script sources) is extraordinary.

Beyond an attentive moderator or pre-screening content, I
can really see no way to 'seal all the security holes',
..beyond removing the site from the internet.

So all of the web forums out there employing vBulletin, UBB, etc. They're
all prone to such attacks right? If that's the case they'd all be out of
business by now.

It would be nice if you could show some code exploits to illustrate your
point.
 
J

Jim Ley

So all of the web forums out there employing vBulletin, UBB, etc. They're
all prone to such attacks right? If that's the case they'd all be out of
business by now.

No they have lots of heuristics - making sure it starts http:// making
sure script isn't allowed, making sure everything's encoded - they're
not perfect, and there's always moderators eventually - people
generally aren't as bad as you think...

Jim.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top