XSS (Cross Site Scripting) are a kind of attacks which are fairly popular these days and could target anyone, but are not nearly well known from most people.
In this post, I’ll try to give a short explanation of what they are.
XSS : the principle
Simply put, a XSS (or Cross Site Scripting, not to confuse with CSS, Cascading Style Sheets) happens when a website accepts user contributed content (ex : posts, message on a forum, comments, nicknames, profile informations, …) and then displays it without proper validation or filtering.
XSS : An example
A legit user would then authenticate himself on the social networking website, and browse profiles, passing by the malicious one, which would add the malicious user as a friend.
Well this is not just a fictious example. Something even worse happened.
Now imagine that the purpose is not to add someone as your buddy but to steal a session cookie to your banking website … freaky ?
XSS : What to do ?
As the developer of a web site where users are allowed to submit content, the lesson is simple : never trust user submitted content.
Any such content must be correctly filtered to remove any potential harmful characters. All languages used to develop web applications provide a function to escape HTML tags, which can be of great help to avoid XSS.