Understanding XSS Attacks ...

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
pepe_lepew1962
Forum Commoner
Posts: 44
Joined: Thu Nov 20, 2008 10:29 am

Understanding XSS Attacks ...

Post by pepe_lepew1962 »

Hello:

I am really trying to understand XSS attacks and can't seem to wrap my head around it, I would rather seem like a fool than program like one with holes in it. My problem is understanding how an attack occurs. Let's say Mary logs into the system and creates a record in the table via an html form. I have php filters and validation for the data before it actually goes into mysql table. My question is how does John attack my website? Or more important, how does he actually change files? If he were to have a log in and gains access because it doesn't take much to register, how? Is it a matter of the filter being bad and his XSS scipt is in a record and when someone open/views that record (field) the script is launched? I have read lots on how the javascript, for example, is placed in the url or form fields but nothing explains whether the information is saved and launched via the record stored in the database.
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Understanding XSS Attacks ...

Post by social_experiment »

“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
User avatar
php3ch0
Forum Contributor
Posts: 212
Joined: Sun Nov 13, 2005 7:35 am
Location: Folkestone, Kent, UK

Re: Understanding XSS Attacks ...

Post by php3ch0 »

Imagine that someone entered this into their firstname

Code: Select all

<script>alert('Hello'); </script>
if you then displayed the firestname on the website it would be able to run the script (possibly from even an external source)
pepe_lepew1962
Forum Commoner
Posts: 44
Joined: Thu Nov 20, 2008 10:29 am

Re: Understanding XSS Attacks ...

Post by pepe_lepew1962 »

Ok, so I am understanding it correctly that the attack is actually thru the record/field and my protection is with filters and sanitizing the information BEFORE it goes into the table and htmlcharacters output???
User avatar
php3ch0
Forum Contributor
Posts: 212
Joined: Sun Nov 13, 2005 7:35 am
Location: Folkestone, Kent, UK

Re: Understanding XSS Attacks ...

Post by php3ch0 »

The other thing to consider is SQLInjection someone inserts sql into your script to modify the database. More information can be found here http://www.unixwiz.net/techtips/sql-injection.html
Post Reply